1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdoutlinercache.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
35 #include "svdoutlinercache.hxx"
36 #include <svx/svdoutl.hxx>
37 #include <svx/svdmodel.hxx>
39 extern SdrOutliner
* SdrMakeOutliner( USHORT nOutlinerMode
, SdrModel
* pModel
);
41 SdrOutlinerCache::SdrOutlinerCache( SdrModel
* pModel
)
43 mpModeOutline( NULL
),
48 SdrOutliner
* SdrOutlinerCache::createOutliner( sal_uInt16 nOutlinerMode
)
50 SdrOutliner
* pOutliner
= NULL
;
52 if( (OUTLINERMODE_OUTLINEOBJECT
== nOutlinerMode
) && mpModeOutline
)
54 pOutliner
= mpModeOutline
;
57 else if( (OUTLINERMODE_TEXTOBJECT
== nOutlinerMode
) && mpModeText
)
59 pOutliner
= mpModeText
;
64 pOutliner
= SdrMakeOutliner( nOutlinerMode
, mpModel
);
65 Outliner
& aDrawOutliner
= mpModel
->GetDrawOutliner();
66 pOutliner
->SetCalcFieldValueHdl( aDrawOutliner
.GetCalcFieldValueHdl() );
72 SdrOutlinerCache::~SdrOutlinerCache()
87 void SdrOutlinerCache::disposeOutliner( SdrOutliner
* pOutliner
)
91 USHORT nOutlMode
= pOutliner
->GetOutlinerMode();
93 if( (OUTLINERMODE_OUTLINEOBJECT
== nOutlMode
) && (NULL
== mpModeOutline
) )
95 mpModeOutline
= pOutliner
;
97 pOutliner
->SetVertical( false );
99 // #101088# Deregister on outliner, might be reused from outliner cache
100 pOutliner
->SetNotifyHdl( Link() );
102 else if( (OUTLINERMODE_TEXTOBJECT
== nOutlMode
) && (NULL
== mpModeText
) )
104 mpModeText
= pOutliner
;
106 pOutliner
->SetVertical( false );
108 // #101088# Deregister on outliner, might be reused from outliner cache
109 pOutliner
->SetNotifyHdl( Link() );