nss: upgrade to release 3.73
[LibreOffice.git] / svx / source / svdraw / svdoutl.cxx
blobfed5e1c82f2558869ba80026ecea5cfe15848c6d
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 <svl/itempool.hxx>
25 #include <editeng/editview.hxx>
28 SdrOutliner::SdrOutliner( SfxItemPool* pItemPool, OutlinerMode nMode )
29 : Outliner( pItemPool, nMode ),
30 mpVisualizedPage(nullptr)
35 SdrOutliner::~SdrOutliner()
40 void SdrOutliner::SetTextObj( const SdrTextObj* pObj )
42 if( pObj && pObj != mpTextObj.get() )
44 SetUpdateMode(false);
45 OutlinerMode nOutlinerMode2 = OutlinerMode::OutlineObject;
46 if ( !pObj->IsOutlText() )
47 nOutlinerMode2 = OutlinerMode::TextObject;
48 Init( nOutlinerMode2 );
50 SetGlobalCharStretching();
52 EEControlBits nStat = GetControlWord();
53 nStat &= ~EEControlBits( EEControlBits::STRETCHING | EEControlBits::AUTOPAGESIZE );
54 SetControlWord(nStat);
56 Size aMaxSize( 100000,100000 );
57 SetMinAutoPaperSize( Size() );
58 SetMaxAutoPaperSize( aMaxSize );
59 SetPaperSize( aMaxSize );
60 ClearPolygon();
63 mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
66 void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
68 mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
71 OUString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos,
72 std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor)
74 bool bOk = false;
75 OUString aRet;
77 if(mpTextObj.is())
78 bOk = mpTextObj->CalcFieldValue(rField, nPara, nPos, false, rpTxtColor, rpFldColor, aRet);
80 if (!bOk)
81 aRet = Outliner::CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor);
83 return aRet;
86 const SdrTextObj* SdrOutliner::GetTextObj() const
88 return mpTextObj.get();
91 bool SdrOutliner::hasEditViewCallbacks() const
93 for (size_t a(0); a < GetViewCount(); a++)
95 OutlinerView* pOutlinerView = GetView(a);
97 if (pOutlinerView && pOutlinerView->GetEditView().getEditViewCallbacks())
99 return true;
103 return false;
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */