Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "DrawDocShell.hxx"
31 : : #include <vcl/svapp.hxx>
32 : :
33 : : #include <sfx2/docfac.hxx>
34 : : #include <sfx2/objface.hxx>
35 : :
36 : : #include <svx/svxids.hrc>
37 : : #include <svl/srchitem.hxx>
38 : : #include <svx/srchdlg.hxx>
39 : : #include <editeng/flstitem.hxx>
40 : : #include <svl/eitem.hxx>
41 : : #include <svl/intitem.hxx>
42 : : #include <sfx2/printer.hxx>
43 : : #include <sfx2/docfile.hxx>
44 : : #include <svx/drawitem.hxx>
45 : : #include <sfx2/dispatch.hxx>
46 : : #include <svl/whiter.hxx>
47 : : #include <svl/itempool.hxx>
48 : : #include <svtools/ctrltool.hxx>
49 : : #include <svtools/filter.hxx>
50 : : #include <sot/clsids.hxx>
51 : : #include <svl/cjkoptions.hxx>
52 : : #include <svl/visitem.hxx>
53 : :
54 : : #include <svx/svdoutl.hxx>
55 : :
56 : : #include <sfx2/fcontnr.hxx>
57 : :
58 : : #include "app.hrc"
59 : : #include "app.hxx"
60 : : #include "strmname.h"
61 : : #include "stlpool.hxx"
62 : : #include "strings.hrc"
63 : : #include "View.hxx"
64 : : #include "drawdoc.hxx"
65 : : #include "sdpage.hxx"
66 : : #include "glob.hrc"
67 : : #include "res_bmp.hrc"
68 : : #include "fupoor.hxx"
69 : : #include "fusearch.hxx"
70 : : #include "ViewShell.hxx"
71 : : #include "sdresid.hxx"
72 : : #include "slideshow.hxx"
73 : : #include "drawview.hxx"
74 : : #include "FrameView.hxx"
75 : : #include "unomodel.hxx"
76 : : #include "undo/undomanager.hxx"
77 : : #include "undo/undofactory.hxx"
78 : : #include "OutlineView.hxx"
79 : : #include "ViewShellBase.hxx"
80 : :
81 : : using namespace sd;
82 : : #define DrawDocShell
83 : : #include "sdslots.hxx"
84 : :
85 [ + + ][ + - ]: 2263 : SFX_IMPL_INTERFACE(DrawDocShell, SfxObjectShell, SdResId(0))
[ + - ][ + - ]
86 : : {
87 : 25 : SFX_CHILDWINDOW_REGISTRATION(SvxSearchDialogWrapper::GetChildWindowId());
88 : 25 : }
89 : :
90 : :
91 : : namespace sd {
92 : :
93 : : GraphicFilter* GetGrfFilter();
94 : :
95 : : /*************************************************************************
96 : : |*
97 : : |* SFX-Slotmaps und -Definitionen
98 : : |*
99 : : \************************************************************************/
100 [ + + ][ + + ]: 9734 : TYPEINIT1( DrawDocShell, SfxObjectShell );
101 : :
102 [ + + ][ + - ]: 13904 : SFX_IMPL_OBJECTFACTORY(
[ + - ][ + - ]
[ + - ][ # # ]
103 : : DrawDocShell,
104 : : SvGlobalName(SO3_SIMPRESS_CLASSID),
105 : : SFXOBJECTSHELL_STD_NORMAL,
106 : : "simpress" )
107 : :
108 : : /*************************************************************************
109 : : |*
110 : : |* Construct
111 : : |*
112 : : \************************************************************************/
113 : :
114 : 172 : void DrawDocShell::Construct( bool bClipboard )
115 : : {
116 : 172 : mbInDestruction = sal_False;
117 : 172 : SetSlotFilter(); // setzt Filter zurueck
118 : :
119 : 172 : mbOwnDocument = mpDoc == 0;
120 [ + - ]: 172 : if( mbOwnDocument )
121 [ + - ]: 172 : mpDoc = new SdDrawDocument(meDocType, this);
122 : :
123 : : // The document has been created so we can call UpdateRefDevice() to set
124 : : // the document's ref device.
125 : 172 : UpdateRefDevice();
126 : :
127 : 172 : SetBaseModel( new SdXImpressDocument( this, bClipboard ) );
128 : 172 : SetPool( &mpDoc->GetItemPool() );
129 [ + - ]: 172 : mpUndoManager = new sd::UndoManager;
130 : 172 : mpDoc->SetSdrUndoManager( mpUndoManager );
131 [ + - ]: 172 : mpDoc->SetSdrUndoFactory( new sd::UndoFactory );
132 : 172 : UpdateTablePointers();
133 : 172 : SetStyleFamily(5); //CL: eigentlich SFX_STYLE_FAMILY_PSEUDO
134 : 172 : }
135 : :
136 : : /*************************************************************************
137 : : |*
138 : : |* Konstruktor 1
139 : : |*
140 : : \************************************************************************/
141 : :
142 : 27 : DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
143 : : sal_Bool bDataObject,
144 : : DocumentType eDocumentType) :
145 : : SfxObjectShell( eMode == SFX_CREATE_MODE_INTERNAL ? SFX_CREATE_MODE_EMBEDDED : eMode),
146 : : mpDoc(NULL),
147 : : mpUndoManager(NULL),
148 : : mpPrinter(NULL),
149 : : mpViewShell(NULL),
150 : : mpFontList(NULL),
151 : : meDocType(eDocumentType),
152 : : mpFilterSIDs(0),
153 : : mbSdDataObj(bDataObject),
154 : : mbOwnPrinter(sal_False),
155 [ + - ][ + - ]: 27 : mbNewDocument( sal_True )
[ + - ][ # # ]
[ # # ]
156 : : {
157 [ + - # # ]: 27 : Construct( eMode == SFX_CREATE_MODE_INTERNAL );
158 : 27 : }
159 : :
160 : : /*************************************************************************
161 : : |*
162 : : |* Konstruktor 2
163 : : |*
164 : : \************************************************************************/
165 : :
166 : 145 : DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, sal_Bool bDataObject, DocumentType eDocumentType ) :
167 : : SfxObjectShell( nModelCreationFlags ),
168 : : mpDoc(NULL),
169 : : mpUndoManager(NULL),
170 : : mpPrinter(NULL),
171 : : mpViewShell(NULL),
172 : : mpFontList(NULL),
173 : : meDocType(eDocumentType),
174 : : mpFilterSIDs(0),
175 : : mbSdDataObj(bDataObject),
176 : : mbOwnPrinter(sal_False),
177 [ + - ][ + - ]: 145 : mbNewDocument( sal_True )
[ + - ]
178 : : {
179 [ + - + - ]: 145 : Construct( sal_False );
180 : 145 : }
181 : :
182 : : /*************************************************************************
183 : : |*
184 : : |* Konstruktor 3
185 : : |*
186 : : \************************************************************************/
187 : :
188 : 0 : DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
189 : : sal_Bool bDataObject,
190 : : DocumentType eDocumentType) :
191 : : SfxObjectShell(eMode == SFX_CREATE_MODE_INTERNAL ? SFX_CREATE_MODE_EMBEDDED : eMode),
192 : : mpDoc(pDoc),
193 : : mpUndoManager(NULL),
194 : : mpPrinter(NULL),
195 : : mpViewShell(NULL),
196 : : mpFontList(NULL),
197 : : meDocType(eDocumentType),
198 : : mpFilterSIDs(0),
199 : : mbSdDataObj(bDataObject),
200 : : mbOwnPrinter(sal_False),
201 [ # # ][ # # ]: 0 : mbNewDocument( sal_True )
[ # # ][ # # ]
[ # # ]
202 : : {
203 [ # # # # ]: 0 : Construct( eMode == SFX_CREATE_MODE_INTERNAL );
204 : 0 : }
205 : :
206 : : /*************************************************************************
207 : : |*
208 : : |* Destruktor
209 : : |*
210 : : \************************************************************************/
211 : :
212 [ + - ][ + - ]: 299 : DrawDocShell::~DrawDocShell()
[ + - ][ + - ]
[ + - ][ # # ]
213 : : {
214 : : // Tell all listeners that the doc shell is about to be
215 : : // destroyed. This has been introduced for the PreviewRenderer to
216 : : // free its view (that uses the item poll of the doc shell) but
217 : : // may be usefull in other places as well.
218 [ + - ][ + - ]: 169 : Broadcast(SfxSimpleHint(SFX_HINT_DYING));
[ + - ][ + - ]
[ + - ][ + - ]
219 : :
220 : 169 : mbInDestruction = sal_True;
221 : :
222 [ + - ][ + - ]: 169 : SetDocShellFunction(0);
[ + - ][ + - ]
[ + - ][ + - ]
223 : :
224 [ + - ][ + - ]: 169 : delete mpFontList;
[ + - ][ + - ]
225 : :
226 [ + - ][ + - ]: 169 : if( mpDoc )
227 [ + - ][ + - ]: 169 : mpDoc->SetSdrUndoManager( 0 );
228 [ + - ][ + - ]: 169 : delete mpUndoManager;
[ + - ][ + - ]
229 : :
230 [ + + ][ - + ]: 169 : if (mbOwnPrinter)
231 [ + - ][ + - ]: 3 : delete mpPrinter;
[ # # ][ # # ]
232 : :
233 [ + - ][ + - ]: 169 : if( mbOwnDocument )
234 [ + - ][ + - ]: 169 : delete mpDoc;
[ + - ][ + - ]
235 : :
236 : : // damit der Navigator das Verschwinden des Dokuments mitbekommt
237 [ + - ][ + - ]: 169 : SfxBoolItem aItem(SID_NAVIGATOR_INIT, sal_True);
238 [ - + ][ # # ]: 169 : SfxViewFrame* pFrame = mpViewShell ? mpViewShell->GetFrame() : GetFrame();
[ + - ][ - + ]
[ # # ][ + - ]
239 : :
240 [ + - ][ + - ]: 169 : if( !pFrame )
241 [ + - ][ + - ]: 169 : pFrame = SfxViewFrame::GetFirst( this );
242 : :
243 [ - + ][ - + ]: 169 : if( pFrame )
244 : : pFrame->GetDispatcher()->Execute(
245 [ # # ][ + - ]: 169 : SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L);
[ # # ][ + - ]
246 [ + - ][ + - ]: 364 : }
[ - + ]
[ # # # # ]
[ - + ][ - + ]
[ - + ]
[ # # # # ]
247 : :
248 : : /*************************************************************************
249 : : |*
250 : : |* Slot-Stati setzen
251 : : |*
252 : : \************************************************************************/
253 : :
254 : 0 : void DrawDocShell::GetState(SfxItemSet &rSet)
255 : : {
256 : :
257 [ # # ]: 0 : SfxWhichIter aIter( rSet );
258 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
259 : :
260 [ # # ]: 0 : while ( nWhich )
261 : : {
262 : 0 : sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
263 : 0 : ? GetPool().GetSlotId(nWhich)
264 [ # # # # ]: 0 : : nWhich;
265 : :
266 [ # # # # : 0 : switch ( nSlotId )
# # ]
267 : : {
268 : : case SID_SEARCH_ITEM:
269 : : {
270 [ # # ][ # # ]: 0 : rSet.Put( *SD_MOD()->GetSearchItem() );
271 : : }
272 : 0 : break;
273 : :
274 : : case SID_CLOSEDOC:
275 : : {
276 : 0 : sal_Bool bDisabled = sal_False;
277 [ # # ]: 0 : if (bDisabled)
278 : : {
279 [ # # ]: 0 : rSet.DisableItem(SID_CLOSEDOC);
280 : : }
281 : : else
282 : : {
283 [ # # ][ # # ]: 0 : GetSlotState(SID_CLOSEDOC, SfxObjectShell::GetInterface(), &rSet);
284 : : }
285 : : }
286 : 0 : break;
287 : :
288 : : case SID_SEARCH_OPTIONS:
289 : : {
290 : : sal_uInt16 nOpt = SEARCH_OPTIONS_SEARCH |
291 : : SEARCH_OPTIONS_WHOLE_WORDS |
292 : : SEARCH_OPTIONS_BACKWARDS |
293 : : SEARCH_OPTIONS_REG_EXP |
294 : : SEARCH_OPTIONS_EXACT |
295 : : SEARCH_OPTIONS_SIMILARITY |
296 : 0 : SEARCH_OPTIONS_SELECTION;
297 : :
298 [ # # ][ # # ]: 0 : if (!IsReadOnly())
299 : : {
300 : 0 : nOpt |= SEARCH_OPTIONS_REPLACE;
301 : 0 : nOpt |= SEARCH_OPTIONS_REPLACE_ALL;
302 : : }
303 : :
304 [ # # ][ # # ]: 0 : rSet.Put(SfxUInt16Item(nWhich, nOpt));
[ # # ]
305 : : }
306 : 0 : break;
307 : :
308 : : case SID_VERSION:
309 : : {
310 [ # # ][ # # ]: 0 : GetSlotState( SID_VERSION, SfxObjectShell::GetInterface(), &rSet );
311 : : }
312 : 0 : break;
313 : :
314 : : case SID_CHINESE_CONVERSION:
315 : : case SID_HANGUL_HANJA_CONVERSION:
316 : : {
317 [ # # ][ # # ]: 0 : rSet.Put(SfxVisibilityItem(nWhich, SvtCJKOptions().IsAnyEnabled()));
[ # # ][ # # ]
[ # # ][ # # ]
318 : : }
319 : 0 : break;
320 : :
321 : : default:
322 : 0 : break;
323 : : }
324 [ # # ]: 0 : nWhich = aIter.NextWhich();
325 : : }
326 : :
327 [ # # ]: 0 : SfxViewFrame* pFrame = SfxViewFrame::Current();
328 : :
329 [ # # ]: 0 : if (pFrame)
330 : : {
331 [ # # ][ # # ]: 0 : if (rSet.GetItemState(SID_RELOAD) != SFX_ITEM_UNKNOWN)
332 : : {
333 : : pFrame->GetSlotState(SID_RELOAD,
334 [ # # ][ # # ]: 0 : pFrame->GetInterface(), &rSet);
335 : : }
336 [ # # ]: 0 : }
337 : 0 : }
338 : :
339 : 0 : void DrawDocShell::InPlaceActivate( sal_Bool bActive )
340 : : {
341 : 0 : ViewShell* pViewSh = NULL;
342 : 0 : SfxViewShell* pSfxViewSh = NULL;
343 : 0 : SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(this, false);
344 : 0 : std::vector<FrameView*> &rViews = mpDoc->GetFrameViewList();
345 : :
346 [ # # ]: 0 : if( !bActive )
347 : : {
348 : 0 : std::vector<FrameView*>::iterator pIter;
349 [ # # ][ # # ]: 0 : for ( pIter = rViews.begin(); pIter != rViews.end(); ++pIter )
350 [ # # ][ # # ]: 0 : delete *pIter;
351 : :
352 : 0 : rViews.clear();
353 : :
354 [ # # ]: 0 : while (pSfxViewFrame)
355 : : {
356 : : // Anzahl FrameViews ermitteln
357 [ # # ]: 0 : pSfxViewSh = pSfxViewFrame->GetViewShell();
358 [ # # ][ # # ]: 0 : pViewSh = PTR_CAST( ViewShell, pSfxViewSh );
[ # # ][ # # ]
359 : :
360 [ # # ][ # # ]: 0 : if ( pViewSh && pViewSh->GetFrameView() )
[ # # ][ # # ]
361 : : {
362 [ # # ]: 0 : pViewSh->WriteFrameViewData();
363 [ # # ][ # # ]: 0 : rViews.push_back( new FrameView( mpDoc, pViewSh->GetFrameView() ) );
[ # # ][ # # ]
364 : : }
365 : :
366 [ # # ]: 0 : pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
367 : : }
368 : : }
369 : :
370 : 0 : SfxObjectShell::InPlaceActivate( bActive );
371 : :
372 [ # # ]: 0 : if( bActive )
373 : : {
374 [ # # ][ # # ]: 0 : for( sal_uInt32 i = 0; pSfxViewFrame && (i < rViews.size()); i++ )
[ # # ]
375 : : {
376 : : // Anzahl FrameViews ermitteln
377 : 0 : pSfxViewSh = pSfxViewFrame->GetViewShell();
378 [ # # ][ # # ]: 0 : pViewSh = PTR_CAST( ViewShell, pSfxViewSh );
379 : :
380 [ # # ]: 0 : if ( pViewSh )
381 : : {
382 : 0 : pViewSh->ReadFrameViewData( rViews[ i ] );
383 : : }
384 : :
385 : 0 : pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
386 : : }
387 : : }
388 : 0 : }
389 : :
390 : : /*************************************************************************
391 : : |*
392 : : |* SFX-Aktivierung
393 : : |*
394 : : \************************************************************************/
395 : :
396 : 130 : void DrawDocShell::Activate( sal_Bool bMDI)
397 : : {
398 [ + - ]: 130 : if (bMDI)
399 : : {
400 : 130 : ApplySlotFilter();
401 : 130 : mpDoc->StartOnlineSpelling();
402 : : }
403 : 130 : }
404 : :
405 : : /*************************************************************************
406 : : |*
407 : : |* SFX-Deaktivierung
408 : : |*
409 : : \************************************************************************/
410 : :
411 : 130 : void DrawDocShell::Deactivate( sal_Bool )
412 : : {
413 : 130 : }
414 : :
415 : : /*************************************************************************
416 : : |*
417 : : |* SFX-Undomanager zurueckgeben
418 : : |*
419 : : \************************************************************************/
420 : :
421 : 4159 : ::svl::IUndoManager* DrawDocShell::GetUndoManager()
422 : : {
423 : 4159 : return mpUndoManager;
424 : : }
425 : :
426 : :
427 : :
428 : : /*************************************************************************
429 : : |*
430 : : |* Tabellenzeiger auffrischen
431 : : |*
432 : : \************************************************************************/
433 : :
434 : 183 : void DrawDocShell::UpdateTablePointers()
435 : : {
436 [ + - ][ + - ]: 183 : PutItem( SvxColorListItem( mpDoc->GetColorList(), SID_COLOR_TABLE ) );
[ + - ]
437 [ + - ][ + - ]: 183 : PutItem( SvxGradientListItem( mpDoc->GetGradientList(), SID_GRADIENT_LIST ) );
[ + - ]
438 [ + - ][ + - ]: 183 : PutItem( SvxHatchListItem( mpDoc->GetHatchList(), SID_HATCH_LIST ) );
[ + - ]
439 [ + - ][ + - ]: 183 : PutItem( SvxBitmapListItem( mpDoc->GetBitmapList(), SID_BITMAP_LIST ) );
[ + - ]
440 [ + - ][ + - ]: 183 : PutItem( SvxDashListItem( mpDoc->GetDashList(), SID_DASH_LIST ) );
[ + - ]
441 [ + - ][ + - ]: 183 : PutItem( SvxLineEndListItem( mpDoc->GetLineEndList(), SID_LINEEND_LIST ) );
[ + - ]
442 : :
443 : 183 : UpdateFontList();
444 : 183 : }
445 : :
446 : 0 : void DrawDocShell::CancelSearching()
447 : : {
448 [ # # ][ # # ]: 0 : if( dynamic_cast<FuSearch*>( mxDocShellFunction.get() ) )
[ # # ]
449 : : {
450 [ # # ]: 0 : SetDocShellFunction(0);
451 : : }
452 : 0 : }
453 : :
454 : : /*************************************************************************
455 : : |*
456 : : |* den eingestellten SlotFilter anwenden
457 : : |*
458 : : \************************************************************************/
459 : :
460 : 130 : void DrawDocShell::ApplySlotFilter() const
461 : : {
462 : 130 : SfxViewShell* pTestViewShell = SfxViewShell::GetFirst();
463 : :
464 [ + + ]: 272 : while( pTestViewShell )
465 : : {
466 [ + + + - : 402 : if( pTestViewShell->GetObjectShell()
+ - ][ + + ]
467 : : == const_cast<DrawDocShell*>( this )
468 : 130 : && pTestViewShell->GetViewFrame()
469 : 130 : && pTestViewShell->GetViewFrame()->GetDispatcher() )
470 : : {
471 : 130 : SfxDispatcher* pDispatcher = pTestViewShell->GetViewFrame()->GetDispatcher();
472 : :
473 [ - + ]: 130 : if( mpFilterSIDs )
474 : 0 : pDispatcher->SetSlotFilter( mbFilterEnable, mnFilterCount, mpFilterSIDs );
475 : : else
476 : 130 : pDispatcher->SetSlotFilter();
477 : :
478 [ + - ]: 130 : if( pDispatcher->GetBindings() )
479 : 130 : pDispatcher->GetBindings()->InvalidateAll( sal_True );
480 : : }
481 : :
482 : 142 : pTestViewShell = SfxViewShell::GetNext( *pTestViewShell );
483 : : }
484 : 130 : }
485 : :
486 : 10121 : void DrawDocShell::SetModified( sal_Bool bSet /* = sal_True */ )
487 : : {
488 : 10121 : SfxObjectShell::SetModified( bSet );
489 : :
490 : : // change model state, too
491 : : // only set the changed state if modification is enabled
492 [ + + ]: 10121 : if( IsEnableSetModified() )
493 : : {
494 [ + - ]: 9877 : if ( mpDoc )
495 : 9877 : mpDoc->NbcSetChanged( bSet );
496 : :
497 [ + - ]: 9877 : Broadcast( SfxSimpleHint( SFX_HINT_DOCCHANGED ) );
498 : : }
499 : 10121 : }
500 : :
501 : : /*************************************************************************
502 : : |*
503 : : |* Callback fuer ExecuteSpellPopup()
504 : : |*
505 : : \************************************************************************/
506 : :
507 : : // ExecuteSpellPopup now handled by DrawDocShell. This is necessary
508 : : // to get hands on the outliner and the text object.
509 : 0 : IMPL_LINK(DrawDocShell, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
510 : : {
511 : 0 : SdrObject* pObj = NULL;
512 : 0 : SdrOutliner* pOutl = NULL;
513 : :
514 [ # # ]: 0 : if(GetViewShell())
515 : : {
516 : 0 : pOutl = GetViewShell()->GetView()->GetTextEditOutliner();
517 : 0 : pObj = GetViewShell()->GetView()->GetTextEditObject();
518 : : }
519 : :
520 : 0 : mpDoc->ImpOnlineSpellCallback(pInfo, pObj, pOutl);
521 : 0 : return(0);
522 : : }
523 : :
524 : 11 : void DrawDocShell::ClearUndoBuffer()
525 : : {
526 : : // clear possible undo buffers of outliners
527 : 11 : SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(this, false);
528 [ - + ]: 11 : while(pSfxViewFrame)
529 : : {
530 [ # # ]: 0 : ViewShellBase* pViewShellBase = dynamic_cast< ViewShellBase* >( pSfxViewFrame->GetViewShell() );
531 [ # # ]: 0 : if( pViewShellBase )
532 : : {
533 [ # # ]: 0 : ::boost::shared_ptr<ViewShell> pViewSh( pViewShellBase->GetMainViewShell() );
534 [ # # ]: 0 : if( pViewSh.get() )
535 : : {
536 : 0 : ::sd::View* pView = pViewSh->GetView();
537 [ # # ]: 0 : if( pView )
538 : : {
539 [ # # ]: 0 : pView->SdrEndTextEdit();
540 [ # # ]: 0 : sd::OutlineView* pOutlView = dynamic_cast< sd::OutlineView* >( pView );
541 [ # # ]: 0 : if( pOutlView )
542 : : {
543 : 0 : SdrOutliner* pOutliner = pOutlView->GetOutliner();
544 [ # # ]: 0 : if( pOutliner )
545 [ # # ][ # # ]: 0 : pOutliner->GetUndoManager().Clear();
546 : : }
547 : : }
548 [ # # ]: 0 : }
549 : : }
550 : 0 : pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
551 : : }
552 : :
553 : 11 : ::svl::IUndoManager* pUndoManager = GetUndoManager();
554 [ - + ][ - + ]: 11 : if(pUndoManager && pUndoManager->GetUndoActionCount())
[ + - ]
555 : 0 : pUndoManager->Clear();
556 : 11 : }
557 : :
558 [ + - ][ + - ]: 75 : } // end of namespace sd
559 : :
560 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|