LibreOffice Module svx (master) 1
svdoutl.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
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>
26
27
29: Outliner( pItemPool, nMode ),
30 mpVisualizedPage(nullptr)
31{
32}
33
34
36{
37}
38
39
41{
42 if( pObj && pObj != mxWeakTextObj.get().get() )
43 {
44 SetUpdateLayout(false);
45 OutlinerMode nOutlinerMode2 = OutlinerMode::OutlineObject;
46 if ( !pObj->IsOutlText() )
47 nOutlinerMode2 = OutlinerMode::TextObject;
48 Init( nOutlinerMode2 );
49
51
53 nStat &= ~EEControlBits( EEControlBits::STRETCHING | EEControlBits::AUTOPAGESIZE );
54 SetControlWord(nStat);
55
56 Size aMaxSize( 100000,100000 );
58 SetMaxAutoPaperSize( aMaxSize );
59 SetPaperSize( aMaxSize );
62 }
63
64 mxWeakTextObj = const_cast< SdrTextObj* >(pObj);
65}
66
68{
69 mxWeakTextObj = const_cast< SdrTextObj* >(pObj);
70}
71
72OUString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos,
73 std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor)
74{
75 bool bOk = false;
76 OUString aRet;
77
78 if(auto pTextObj = mxWeakTextObj.get())
79 bOk = pTextObj->CalcFieldValue(rField, nPara, nPos, false, rpTxtColor, rpFldColor, aRet);
80
81 if (!bOk)
82 aRet = Outliner::CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor);
83
84 return aRet;
85}
86
88{
89 return mxWeakTextObj.get().get();
90}
91
93{
94 for (size_t a(0); a < GetViewCount(); a++)
95 {
96 OutlinerView* pOutlinerView = GetView(a);
97
98 if (pOutlinerView && pOutlinerView->GetEditView().getEditViewCallbacks())
99 {
100 return true;
101 }
102 }
103
104 return false;
105}
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EditViewCallbacks * getEditViewCallbacks() const
EditView & GetEditView() const
void SetMaxAutoPaperSize(const Size &rSz)
void SetTextColumns(sal_Int16 nColumns, sal_Int32 nSpacing)
void SetGlobalCharStretching(double nX=100.0, double nY=100.0)
void SetMinAutoPaperSize(const Size &rSz)
void SetPaperSize(const Size &rSize)
bool SetUpdateLayout(bool bUpdate)
OutlinerView * GetView(size_t nIndex) const
EEControlBits GetControlWord() const
void SetControlWord(EEControlBits nWord)
void ClearPolygon()
void Init(OutlinerMode nMode)
size_t GetViewCount() const
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor)
::unotools::WeakReference< SdrTextObj > mxWeakTextObj
Definition: svdoutl.hxx:31
void SetTextObj(const SdrTextObj *pObj)
Definition: svdoutl.cxx:40
bool hasEditViewCallbacks() const
Definition: svdoutl.cxx:92
virtual ~SdrOutliner() override
Definition: svdoutl.cxx:35
const SdrTextObj * GetTextObj() const
Definition: svdoutl.cxx:87
SdrOutliner(SfxItemPool *pItemPool, OutlinerMode nMode)
Definition: svdoutl.cxx:28
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor) override
Definition: svdoutl.cxx:72
void SetTextObjNoInit(const SdrTextObj *pObj)
Definition: svdoutl.cxx:67
sal_Int32 GetTextColumnsSpacing() const
Definition: svdotext.cxx:1797
bool IsOutlText() const
Definition: svdotext.hxx:333
sal_Int16 GetTextColumnsNumber() const
Definition: svdotext.cxx:1782
rtl::Reference< interface_type > SAL_CALL get() const
EEControlBits
uno_Any a
sal_uInt16 nPos
OutlinerMode