1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/svdoutl.hxx>
21 #include <editeng/outliner.hxx>
22 #include <svx/svdotext.hxx>
23 #include <editeng/editstat.hxx>
24 #include <svx/svdmodel.hxx>
25 #include <editeng/eeitem.hxx>
26 #include <svl/itempool.hxx>
29 SdrOutliner::SdrOutliner( SfxItemPool
* pItemPool
, sal_uInt16 nMode
)
30 : Outliner( pItemPool
, nMode
),
31 //mpPaintInfoRec( NULL )
37 SdrOutliner::~SdrOutliner()
42 void SdrOutliner::SetTextObj( const SdrTextObj
* pObj
)
44 if( pObj
&& pObj
!= mpTextObj
.get() )
47 sal_uInt16 nOutlinerMode2
= OUTLINERMODE_OUTLINEOBJECT
;
48 if ( !pObj
->IsOutlText() )
49 nOutlinerMode2
= OUTLINERMODE_TEXTOBJECT
;
50 Init( nOutlinerMode2
);
52 SetGlobalCharStretching(100,100);
54 sal_uIntPtr nStat
= GetControlWord();
55 nStat
&= ~( EE_CNTRL_STRETCHING
| EE_CNTRL_AUTOPAGESIZE
);
56 SetControlWord(nStat
);
59 Size
aMaxSize( 100000,100000 );
60 SetMinAutoPaperSize( aNullSize
);
61 SetMaxAutoPaperSize( aMaxSize
);
62 SetPaperSize( aMaxSize
);
66 mpTextObj
.reset( const_cast< SdrTextObj
* >(pObj
) );
69 void SdrOutliner::SetTextObjNoInit( const SdrTextObj
* pObj
)
71 mpTextObj
.reset( const_cast< SdrTextObj
* >(pObj
) );
74 OUString
SdrOutliner::CalcFieldValue(const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_Int32 nPos
,
75 Color
*& rpTxtColor
, Color
*& rpFldColor
)
81 bOk
= static_cast< SdrTextObj
* >( mpTextObj
.get())->CalcFieldValue(rField
, nPara
, nPos
, false, rpTxtColor
, rpFldColor
, aRet
);
84 aRet
= Outliner::CalcFieldValue(rField
, nPara
, nPos
, rpTxtColor
, rpFldColor
);
89 const SdrTextObj
* SdrOutliner::GetTextObj() const
92 return static_cast< SdrTextObj
* >( mpTextObj
.get() );
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */