LibreOffice Module svx (master) 1
svdtext.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/svdotext.hxx>
21#include <svx/svdetc.hxx>
22#include <editeng/outlobj.hxx>
23#include <svx/svdoutl.hxx>
24#include <svx/svdmodel.hxx>
25#include <svl/itemset.hxx>
26#include <osl/diagnose.h>
27#include <libxml/xmlwriter.h>
28#include <memory>
29
31: mrObject( rObject )
32, mbPortionInfoChecked( false )
33{
34 OSL_ENSURE(&mrObject, "SdrText created without SdrTextObj (!)");
35}
36
38{
39}
40
41void SdrText::CheckPortionInfo( const SdrOutliner& rOutliner )
42{
44 return;
45
46 // #i102062# no action when the Outliner is the HitTestOutliner,
47 // this will remove WrongList info at the OPO
49 return;
50
51 // TODO: optimization: we could create a BigTextObject
53
55 {
56 // #i102062# MemoryLeak closed
58 }
59}
60
62{
65}
66
68{
69 return const_cast< SdrText* >(this)->GetObjectItemSet();
70}
71
73{
74 // Update HitTestOutliner
76
77 if(pTestObj)
78 if ( (!pTestObj->GetOutlinerParaObject() && !mpOutlinerParaObject)
80 {
82 }
83
84 mpOutlinerParaObject = std::move(pTextObject);
86}
87
89{
90 return mpOutlinerParaObject ? &*mpOutlinerParaObject : nullptr;
91}
92
94{
95 return mpOutlinerParaObject ? &*mpOutlinerParaObject : nullptr;
96}
97
100{
101 // Update HitTestOutliner
103
104 if(pTestObj)
105 if ( (!pTestObj->GetOutlinerParaObject() && !mpOutlinerParaObject)
107 {
109 }
110
112 mbPortionInfoChecked = false;
113
114 return pOPO;
115}
116
118{
120 return;
121
122 std::unique_ptr<Outliner> pOutliner(
124 nOutlMode,
126
127 if(pOutliner)
128 {
130 pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() );
131 pOutliner->SetStyleSheet( 0, GetStyleSheet());
132 SetOutlinerParaObject( pOutliner->CreateParaObject() );
133 }
134}
135
137{
138 return mrObject.GetObjectItemSet();
139}
140
142{
143 return mrObject.GetStyleSheet();
144}
145
147{
148 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrText"));
150 (void)xmlTextWriterEndElement(pWriter);
151}
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool ShouldCreateBigTextObject() const
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
const Link< EditFieldInfo *, void > & GetCalcFieldValueHdl() const
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
Definition: svdmodel.cxx:642
SdrOutliner & GetHitTestOutliner() const
Definition: svdmodel.hxx:323
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2247
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1972
void SetTextObj(const SdrTextObj *pObj)
Definition: svdoutl.cxx:40
const SdrTextObj * GetTextObj() const
Definition: svdoutl.cxx:87
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Definition: svdotext.cxx:1344
OutlinerParaObject * GetOutlinerParaObject()
Definition: svdtext.cxx:88
std::optional< OutlinerParaObject > mpOutlinerParaObject
Definition: svdtext.hxx:75
void CheckPortionInfo(const SdrOutliner &rOutliner)
Definition: svdtext.cxx:41
SdrTextObj & mrObject
Definition: svdtext.hxx:76
bool mbPortionInfoChecked
Definition: svdtext.hxx:77
virtual SfxStyleSheet * GetStyleSheet() const
Definition: svdtext.cxx:141
virtual const SfxItemSet & GetObjectItemSet()
Definition: svdtext.cxx:136
SdrText(SdrTextObj &rObject)
Definition: svdtext.cxx:30
void ReformatText()
Definition: svdtext.cxx:61
virtual ~SdrText() override
Definition: svdtext.cxx:37
void ForceOutlinerParaObject(OutlinerMode nOutlMode)
Definition: svdtext.cxx:117
const SfxItemSet & GetItemSet() const
Definition: svdtext.cxx:67
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdtext.cxx:146
std::optional< OutlinerParaObject > RemoveOutlinerParaObject()
returns the current OutlinerParaObject and removes it from this instance
Definition: svdtext.cxx:99
virtual void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdtext.cxx:72
struct _xmlTextWriter * xmlTextWriterPtr
OutlinerMode
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
Definition: svdetc.cxx:340