bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / svdraw / svdoutl.cxx
blob9439514608a9cf310d0739afc9c805ad9bd08d9d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 DBG_NAME(SdrOutliner)
30 SdrOutliner::SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode )
31 : Outliner( pItemPool, nMode ),
32 //mpPaintInfoRec( NULL )
33 mpVisualizedPage(0)
35 DBG_CTOR(SdrOutliner,NULL);
39 SdrOutliner::~SdrOutliner()
41 DBG_DTOR(SdrOutliner,NULL);
45 void SdrOutliner::SetTextObj( const SdrTextObj* pObj )
47 if( pObj && pObj != mpTextObj.get() )
49 SetUpdateMode(sal_False);
50 sal_uInt16 nOutlinerMode2 = OUTLINERMODE_OUTLINEOBJECT;
51 if ( !pObj->IsOutlText() )
52 nOutlinerMode2 = OUTLINERMODE_TEXTOBJECT;
53 Init( nOutlinerMode2 );
55 SetGlobalCharStretching(100,100);
57 sal_uIntPtr nStat = GetControlWord();
58 nStat &= ~( EE_CNTRL_STRETCHING | EE_CNTRL_AUTOPAGESIZE );
59 SetControlWord(nStat);
61 Size aNullSize;
62 Size aMaxSize( 100000,100000 );
63 SetMinAutoPaperSize( aNullSize );
64 SetMaxAutoPaperSize( aMaxSize );
65 SetPaperSize( aMaxSize );
66 ClearPolygon();
69 mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
72 void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
74 mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
77 OUString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
78 Color*& rpTxtColor, Color*& rpFldColor)
80 bool bOk = false;
81 XubString aRet;
83 if(mpTextObj.is())
84 bOk = static_cast< SdrTextObj* >( mpTextObj.get())->CalcFieldValue(rField, nPara, nPos, sal_False, rpTxtColor, rpFldColor, aRet);
86 if (!bOk)
87 aRet = Outliner::CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor);
89 return aRet;
92 const SdrTextObj* SdrOutliner::GetTextObj() const
94 if( mpTextObj.is() )
95 return static_cast< SdrTextObj* >( mpTextObj.get() );
96 else
97 return 0;
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */