23 #include <rtl/ustrbuf.hxx>
31 #include <osl/diagnose.h>
48 #include <document.hxx>
61 const tools::Long SC_NOTECAPTION_MAXWIDTH_TEMP = 12000;
66 const tools::Long SC_NOTECAPTION_BORDERDIST_TEMP = 100;
73 static void SetCaptionLayer(
SdrCaptionObj& rCaption,
bool bShown );
75 static void SetBasicCaptionSettings(
SdrCaptionObj& rCaption,
bool bShown );
82 void ScCaptionUtil::SetCaptionLayer(
SdrCaptionObj& rCaption,
bool bShown )
89 void ScCaptionUtil::SetBasicCaptionSettings(
SdrCaptionObj& rCaption,
bool bShown )
91 SetCaptionLayer( rCaption, bShown );
100 OSL_ENSURE( pObjData,
"ScCaptionUtil::SetCaptionUserData - missing drawing object user data" );
148 aItemSet.
Put(*pExtraItemSet);
163 class ScCaptionCreator
181 void UpdateCaptionPos();
188 Point CalcTailPos(
bool bTailFront );
190 void CreateCaption(
bool bShown,
bool bTailFront );
207 ScCaptionCreator::ScCaptionCreator(
ScDocument& rDoc,
const ScAddress& rPos,
bool bTailFront ) :
212 CreateCaption(
true, bTailFront );
218 mxCaption( xCaption )
230 SdrPage* ScCaptionCreator::GetDrawPage()
233 return pDrawLayer ? pDrawLayer->
GetPage( static_cast< sal_uInt16 >( maPos.Tab() ) ) :
nullptr;
241 Point aTailPos = mxCaption->GetTailPos();
242 aTailPos.setX( ::std::clamp( aTailPos.X(), rVisRect.
Left(), rVisRect.
Right() ) );
243 aTailPos.setY( ::std::clamp( aTailPos.Y(), rVisRect.
Top(), rVisRect.
Bottom() ) );
244 mxCaption->SetTailPos( aTailPos );
250 aCaptPos.setX( ::std::min< tools::Long >( aCaptPos.X(), rVisRect.
Right() - aCaptRect.
GetWidth() ) );
252 aCaptPos.setX( ::std::max< tools::Long >( aCaptPos.X(), rVisRect.
Left() ) );
254 aCaptPos.setY( ::std::min< tools::Long >( aCaptPos.Y(), rVisRect.
Bottom() - aCaptRect.
GetHeight() ) );
256 aCaptPos.setY( ::std::max< tools::Long >( aCaptPos.Y(), rVisRect.
Top() ) );
258 aCaptRect.
SetPos( aCaptPos );
259 mxCaption->SetLogicRect( aCaptRect );
278 tools::Long nNeededSpaceX = nWidth + SC_NOTECAPTION_CELLDIST;
279 tools::Long nNeededSpaceY = nHeight + SC_NOTECAPTION_CELLDIST;
282 bool bFitsWidthLeft = nNeededSpaceX <= nLeftSpace;
283 bool bFitsWidthRight = nNeededSpaceX <= nRightSpace;
284 bool bFitsWidth = nWidth <= rVisRect.
GetWidth();
287 bool bFitsHeightTop = nNeededSpaceY <= nTopSpace;
288 bool bFitsHeightBottom = nNeededSpaceY <= nBottomSpace;
289 bool bFitsHeight = nHeight <= rVisRect.
GetHeight();
292 bool bFitsLeft = bFitsWidthLeft && bFitsHeight;
293 bool bFitsRight = bFitsWidthRight && bFitsHeight;
294 bool bFitsTop = bFitsWidth && bFitsHeightTop;
295 bool bFitsBottom = bFitsWidth && bFitsHeightBottom;
299 if( bFitsLeft || bFitsRight || (!bFitsTop && !bFitsBottom) )
302 bool bPreferLeft = bFitsLeft && (mbNegPage || !bFitsRight);
303 bool bPreferRight = bFitsRight && (!mbNegPage || !bFitsLeft);
305 if( bPreferLeft || (!bPreferRight && (nLeftSpace > nRightSpace)) )
306 aCaptPos.setX( maCellRect.Left() - SC_NOTECAPTION_CELLDIST - nWidth );
308 aCaptPos.setX( maCellRect.Right() + SC_NOTECAPTION_CELLDIST );
310 aCaptPos.setY( maCellRect.Top() + SC_NOTECAPTION_OFFSET_Y );
315 aCaptPos.setX( maCellRect.Left() + SC_NOTECAPTION_OFFSET_X );
318 aCaptPos.setY( maCellRect.Top() - SC_NOTECAPTION_CELLDIST - nHeight );
320 aCaptPos.setY( maCellRect.Bottom() + SC_NOTECAPTION_CELLDIST );
324 aCaptRect.
SetPos( aCaptPos );
325 mxCaption->SetLogicRect( aCaptRect );
326 FitCaptionToRect( pVisRect );
329 void ScCaptionCreator::UpdateCaptionPos()
334 const Point& rOldTailPos = mxCaption->GetTailPos();
335 Point aTailPos = CalcTailPos(
false );
336 if( rOldTailPos != aTailPos )
340 pDrawLayer->
AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *mxCaption ) );
343 tools::Long nDiffX = (rOldTailPos.X() >= 0) ? (aCaptRect.
Left() - rOldTailPos.X()) : (rOldTailPos.X() - aCaptRect.
Right());
344 if( mbNegPage ) nDiffX = -nDiffX - aCaptRect.
GetWidth();
346 aCaptRect.
SetPos( aTailPos +
Point( nDiffX, nDiffY ) );
348 mxCaption->SetTailPos( aTailPos );
349 mxCaption->SetLogicRect( aCaptRect );
356 if( pCaptData && (maPos != pCaptData->
maStart) )
360 pDrawLayer->
AddCalcUndo( std::make_unique<ScUndoObjData>( mxCaption.get(), pCaptData->
maStart, pCaptData->
maEnd, maPos, pCaptData->
maEnd ) );
366 Point ScCaptionCreator::CalcTailPos(
bool bTailFront )
369 bool bTailLeft = bTailFront != mbNegPage;
370 Point aTailPos = bTailLeft ? maCellRect.TopLeft() : maCellRect.TopRight();
372 if( bTailLeft ) aTailPos.AdjustX(10 );
else aTailPos.AdjustX( -10 );
373 aTailPos.AdjustY(10);
377 void ScCaptionCreator::CreateCaption(
bool bShown,
bool bTailFront )
381 Point aTailPos = CalcTailPos( bTailFront );
384 *mrDoc.GetDrawLayer(),
388 ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
391 void ScCaptionCreator::Initialize()
394 mbNegPage = mrDoc.IsNegativePage( maPos.Tab() );
395 if(
SdrPage* pDrawPage = GetDrawPage() )
406 class ScNoteCaptionCreator :
public ScCaptionCreator
416 ScCaptionCreator( rDoc, rPos )
418 SdrPage* pDrawPage = GetDrawPage();
419 OSL_ENSURE( pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - no drawing page" );
424 CreateCaption( rNoteData.
mbShown,
false );
426 OSL_ENSURE( rNoteData.
mxCaption,
"ScNoteCaptionCreator::ScNoteCaptionCreator - missing caption object" );
430 ScCaptionUtil::SetCaptionUserData( *rNoteData.
mxCaption, rPos );
437 ScCaptionCreator( rDoc, rPos, xCaption )
439 SdrPage* pDrawPage = GetDrawPage();
440 OSL_ENSURE( pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - no drawing page" );
441 OSL_ENSURE( xCaption->
getSdrPageFromSdrObject() == pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - wrong drawing page in caption" );
445 ScCaptionUtil::SetCaptionUserData( *xCaption, rPos );
447 ScCaptionUtil::SetBasicCaptionSettings( *xCaption, bShown );
456 mpHead(nullptr),
mpNext(nullptr), mpCaption(nullptr), mbNotOwner(
false)
461 mpHead(nullptr),
mpNext(nullptr), mpCaption(p), mbNotOwner(
false)
470 mpHead(r.mpHead), mpCaption(r.mpCaption), mbNotOwner(
false)
488 : mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbNotOwner(false)
490 r.replaceInList(
this );
491 r.mpCaption =
nullptr;
492 r.mbNotOwner =
false;
504 r.replaceInList(
this );
505 r.mpCaption =
nullptr;
506 r.mbNotOwner =
false;
555 mpFirst(p), mnRefs(1)
574 while (pThat && pThat !=
this && pThat->mpNext !=
this)
576 pThat = pThat->mpNext;
578 if (pThat && pThat !=
this)
580 assert(pThat->mpNext ==
this);
581 pThat->mpNext = pNew;
596 #if OSL_DEBUG_LEVEL > 0
597 oslInterlockedCount
nCount = 0;
600 while (pThat && pThat !=
this && pThat->mpNext !=
this)
603 assert(pThat->mpHead ==
mpHead);
604 assert(pThat->mpHead || !pThat->mpNext);
606 pThat = pThat->mpNext;
607 #if OSL_DEBUG_LEVEL > 0
616 #if OSL_DEBUG_LEVEL > 0
623 #if OSL_DEBUG_LEVEL > 0
626 assert(pThat->mpHead ==
mpHead);
627 assert(pThat->mpHead || !pThat->mpNext);
631 while ((pThat = pThat->mpNext) !=
nullptr);
634 #if OSL_DEBUG_LEVEL > 0
656 #if OSL_DEBUG_LEVEL > 0
663 assert(pThat->mpCaption != p);
664 pThat = pThat->mpNext;
757 SAL_WARN_IF( !pDrawPage,
"sc.core",
"ScCaptionPtr::removeFromDrawPageAndFree - object without drawing page");
762 bool bRecording =
false;
766 SAL_WARN_IF( !pDrawLayer,
"sc.core",
"ScCaptionPtr::removeFromDrawPageAndFree - object without drawing layer");
768 bRecording = (pDrawLayer && pDrawLayer->
IsRecording());
776 if (!bRecording &&
getRefs() <= 1)
804 assert(!pThat->mpNext || pThat->mpHead);
805 assert(pThat->mpHead == pHead);
835 mbDefaultPosSize( true )
857 maNoteData( rNote.maNoteData )
866 maNoteData( rNoteData )
882 return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *
this, nPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos,
maNoteData,
false,
mnPostItId );
924 for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara )
927 aBuffer.append(
'\n' );
928 aBuffer.append(rEngine.
GetText(nPara));
930 return aBuffer.makeStringAndClear();
940 return pEditObj->GetParagraphCount() > 1;
1009 aCreator.UpdateCaptionPos();
1032 "ScPostIt::CreateCaptionFromInitData - note caption should not be created in undo/clip documents" );
1055 OSL_ENSURE( xInitData->mxOutlinerObj || !xInitData->maSimpleText.isEmpty(),
1056 "ScPostIt::CreateCaptionFromInitData - need either outliner para object or simple text" );
1057 if (xInitData->mxOutlinerObj)
1063 ScCaptionUtil::SetDefaultItems( *
maNoteData.
mxCaption,
mrDoc, xInitData->moItemSet ? &*xInitData->moItemSet :
nullptr );
1066 if( xInitData->mbDefaultPosSize )
1072 aCreator.AutoPlaceCaption();
1078 tools::Long nPosX = bNegPage ? (aCellRect.
Left() - xInitData->maCaptionOffset.X()) : (aCellRect.
Right() + xInitData->maCaptionOffset.X());
1079 tools::Long nPosY = aCellRect.
Top() + xInitData->maCaptionOffset.Y();
1082 aCreator.FitCaptionToRect();
1092 OSL_ENSURE( !
maNoteData.
mxCaption,
"ScPostIt::CreateCaption - unexpected caption object found" );
1097 OSL_ENSURE( !
mrDoc.
IsUndo(),
"ScPostIt::CreateCaption - note caption should not be created in undo documents" );
1121 aCaptRect.
Move( aDist.X(), aDist.Y() );
1123 aCreator.FitCaptionToRect();
1129 aCreator.AutoPlaceCaption();
1158 SAL_INFO(
"sc.core",
"ScPostIt::RemoveCaption - forgetting one ref");
1165 std::u16string_view rUserText,
const tools::Rectangle& rVisRect,
bool bTailFront )
1167 OUStringBuffer
aBuffer( rUserText );
1173 if( !aBuffer.isEmpty() )
1174 aBuffer.append(
"\n--------\n" + pNote->
GetText() );
1179 if( !pNoteCaption && aBuffer.isEmpty() )
1184 rVisRect.
Left() + SC_NOTECAPTION_BORDERDIST_TEMP,
1185 rVisRect.
Top() + SC_NOTECAPTION_BORDERDIST_TEMP,
1186 rVisRect.
Right() - SC_NOTECAPTION_BORDERDIST_TEMP,
1187 rVisRect.
Bottom() - SC_NOTECAPTION_BORDERDIST_TEMP );
1190 ScCaptionCreator aCreator( rDoc, rPos, bTailFront );
1193 aCreator.GetCaption().insertToDrawPage( rDrawPage );
1198 if( pNoteCaption && rUserText.empty() )
1210 pCaption->
SetText( aBuffer.makeStringAndClear() );
1211 ScCaptionUtil::SetDefaultItems( *pCaption, rDoc,
nullptr );
1213 tools::Long nMaxWidth = ::std::min< tools::Long >( aVisRect.GetWidth() * 2 / 3, SC_NOTECAPTION_MAXWIDTH_TEMP );
1222 aCreator.AutoPlaceCaption( &aVisRect );
1225 return aCreator.GetCaption();
1236 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1239 ScNoteCaptionCreator aCreator( rDoc, rPos, aNoteData.
mxCaption,
true );
1250 aNoteData.
mxInitData = std::make_shared<ScCaptionInitData>();
1252 rInitData.moItemSet.emplace(std::move(rItemSet));
1253 rInitData.mxOutlinerObj = rOutlinerObj;
1256 rInitData.mbDefaultPosSize = rCaptionRect.
IsEmpty();
1257 if( !rInitData.mbDefaultPosSize )
1261 rInitData.maCaptionOffset.setX( bNegPage ? (aCellRect.
Left() - rCaptionRect.
Right()) : (rCaptionRect.
Left() - aCellRect.
Right()) );
1262 rInitData.maCaptionOffset.setY( rCaptionRect.
Top() - aCellRect.
Top() );
1263 rInitData.maCaptionSize = rCaptionRect.
GetSize();
1271 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1278 bool bShown,
bool bAlwaysCreateCaption, sal_uInt32 nPostItId )
1281 if( !rNoteText.isEmpty() )
1284 aNoteData.
mxInitData = std::make_shared<ScCaptionInitData>();
1286 rInitData.maSimpleText = rNoteText;
1287 rInitData.mbDefaultPosSize =
true;
1291 pNote =
new ScPostIt( rDoc, rPos, aNoteData, bAlwaysCreateCaption, nPostItId );
1294 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1302 maPos(rPos), mpNote(pNote) {}
void SetAuthor(const OUString &rAuthor)
Sets a new author date for this note.
void SetSpecialTextBoxShadow()
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
OUString GetText(LineEnd eEnd=LINEEND_LF) const
static ScCaptionPtr CreateTempCaption(ScDocument &rDoc, const ScAddress &rPos, SdrPage &rDrawPage, std::u16string_view rUserText, const tools::Rectangle &rVisRect, bool bTailFront)
Creates and returns a caption object for a temporary caption.
ScCaptionInitDataRef mxInitData
Author of the note.
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void SetText(const ScAddress &rPos, const OUString &rText)
Changes the caption text of this note.
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
void ShowCaption(const ScAddress &rPos, bool bShow)
Shows or hides the note caption object.
SC_DLLPUBLIC bool IsNegativePage(SCTAB nTab) const
void SetDate(const OUString &rDate)
Sets a new creation date for this note.
OUString maSimpleText
Text object with all text portion formatting.
void ForgetCaption(bool bPreserveData=false)
Forgets the pointer to the note caption object.
bool mbNotOwner
whether this caption object is owned by something else, e.g. held in Undo
oslInterlockedCount mnRefs
use count
void SetTailPos(const Point &rPos)
ScCaptionPtr * mpNext
next in list
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
virtual const tools::Rectangle & GetLogicRect() const override
const OutlinerParaObject * GetOutlinerObject() const
Returns the pointer to the current outliner object, or null.
void AutoStamp()
Sets date and author from system settings.
std::optional< SfxItemSet > moItemSet
static tools::Rectangle GetCellRect(const ScDocument &rDoc, const ScAddress &rPos, bool bMergedCell)
Returns the rectangle for the passed cell address in 1/100 mm.
void removeFromDrawPage(SdrPage &rDrawPage)
Remove from draw page.
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
static void Free(SdrObject *&_rpObject)
void forget()
Forget the SdrCaptionObj pointer in this one instance.
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
ScPostIt(ScDocument &rDoc, const ScAddress &rPos, sal_uInt32 nPostItId=0)
Creates an empty note and its caption object and places it according to the passed cell position...
SC_DLLPUBLIC ScNoteEditEngine & GetNoteEngine()
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
void RemoveCaption()
Removes the caption object from the drawing layer, if this note is its owner.
SC_DLLPUBLIC ScDocumentPool * GetPool()
~ScPostIt()
Removes the caption object from drawing layer, if this note is its owner.
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
SdrMetricItem makeSdrTextMaxFrameWidthItem(tools::Long mnWidth)
SdrPage * getSdrPageFromSdrObject() const
Additional class containing cell annotation data.
void insertToDrawPage(SdrPage &rDrawPage)
Insert to draw page.
Size maCaptionSize
Caption position relative to cell corner.
static ScPostIt * CreateNoteFromCaption(ScDocument &rDoc, const ScAddress &rPos, SdrCaptionObj *pCaption)
Creates a cell note using the passed caption drawing object.
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
void setNotOwner()
Flag that this instance is in Undo, so drawing layer owns it.
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
ScNoteData maNoteData
Parent document containing the note.
NoteEntry(const ScAddress &rPos, const ScPostIt *pNote)
static ScPostIt * CreateNoteFromObjectData(ScDocument &rDoc, const ScAddress &rPos, SfxItemSet &&oItemSet, const OutlinerParaObject &rOutlinerObj, const tools::Rectangle &rCaptionRect, bool bShown)
Creates a cell note based on the passed caption object data.
void ShowCaptionTemp(const ScAddress &rPos, bool bShow=true)
Shows or hides the caption temporarily (does not change internal visibility state).
bool mbShown
Drawing object representing the cell note.
void replaceInList(ScCaptionPtr *pNew) noexcept
Replace this instance with pNew in a list, if any.
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
virtual void SetLayer(SdrLayerID nLayer)
const EditTextObject & GetTextObject() const
Point maCaptionOffset
Simple text without formatting.
SdrCaptionObj * mpCaption
the caption object, managed by head master
SC_DLLPUBLIC void InitDrawLayer(SfxObjectShell *pDocShell=nullptr)
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle &rR, bool bHgt=true, bool bWdt=true) const
bool mbDefaultPosSize
Size of the caption object.
static sal_uInt32 mnLastPostItId
static ScDrawObjData * GetNoteCaptionData(SdrObject *pObj, SCTAB nTab)
Returns the object data, if the passed object is a cell note caption.
std::unique_ptr< ScPostIt > Clone(const ScAddress &rOwnPos, ScDocument &rDestDoc, const ScAddress &rDestPos, bool bCloneCaption) const
Clones this note and its caption object, if specified.
ScCaptionPtr * mpFirst
first in list
void BroadcastObjectChange() const
CAUTION! The following defines must be in the same namespace as the respective type.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetText(const OUString &rStr)
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
OUString GetText() const
Returns the caption text of this note.
SdrModel & getSdrModelFromSdrObject() const
sal_uInt32 GetOrdNum() const
void SetNote(const ScAddress &rPos, std::unique_ptr< ScPostIt > pNote)
Head * mpHead
points to the "master" entry
void AddCalcUndo(std::unique_ptr< SdrUndoAction > pUndo)
void removeFromList()
Remove from current list and close gap.
SdrCaptionObj * GetOrCreateCaption(const ScAddress &rPos) const
Returns the caption object of this note.
void clear()
Just clear everything, while dissolving the list.
virtual void SetLogicRect(const tools::Rectangle &rRect)
void SetMergedItem(const SfxPoolItem &rItem)
std::optional< OutlinerParaObject > mxOutlinerObj
Caption object formatting.
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
virtual SdrObject * RemoveObject(size_t nObjNum)
sal_Int32 GetParagraphCount() const
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
virtual SdrLayerID GetLayer() const
bool HasMultiLineText() const
Returns true, if the caption text of this note contains line breaks.
bool IsInDtorClear() const
OUString getDate(const Date &rDate) const
static Color GetCommentColor()
OUString maAuthor
Creation date of the note.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void setClosed(bool bNew)
std::unique_ptr< char[]> aBuffer
ScCaptionPtr mxCaption
Initial data for invisible notes without SdrObject.
constexpr SdrLayerID SC_LAYER_HIDDEN(4)
ScCaptionInitData()
True = use default position and size for caption.
Some desperate attempt to fight against the caption object ownership mess, to which none of shared/we...
Internal data for a cell annotation.
#define SAL_WARN_IF(condition, area, stream)
const SdrCaptionObj * get() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
sal_uInt32 mnPostItId
Note data with pointer to caption object.
#define SAL_INFO(area, stream)
const SfxItemSet & GetMergedItemSet() const
oslInterlockedCount getRefs() const
constexpr SdrLayerID SC_LAYER_INTERN(2)
SdrCaptionObj * release()
Release all management of the SdrCaptionObj* in all instances of this list and dissolve.
void CreateCaptionFromInitData(const ScAddress &rPos) const
Creates the caption object from initial caption data if existing.
SdrOnOffItem makeSdrShadowItem(bool bShadow)
ScCaptionPtr & operator=(const ScCaptionPtr &r)
const EditTextObject * GetEditTextObject() const
Returns the pointer to the current edit text object, or null.
void removeFromDrawPageAndFree(bool bIgnoreUndo=false)
Remove from draw page and free caption object if no Undo recording.
void dissolve()
Dissolve list when the caption object is released or gone.
void CreateCaption(const ScAddress &rPos, const SdrCaptionObj *pCaption=nullptr)
Creates a new caption object at the passed cell position, clones passed existing caption.
static ScPostIt * CreateNoteFromString(ScDocument &rDoc, const ScAddress &rPos, const OUString &rNoteText, bool bShown, bool bAlwaysCreateCaption, sal_uInt32 nPostItId=0)
Creates a cell note based on the passed string and inserts it into the document.
void reset(SdrCaptionObj *p)
void UpdateCaptionPos(const ScAddress &rPos)
Updates caption position according to position of the passed cell.
ScNoteData(bool bShown=false)
True = note is visible.
const Point & GetTailPos() const
bool m_bDetectedRangeSegmentation false
bool IsCaptionShown() const
Returns true, if the caption object is visible.
void FillEditItemSet(SfxItemSet *pEditSet, const SfxItemSet *pCondSet=nullptr) const
Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSe...