23 #include <rtl/ustrbuf.hxx>
46 #include <document.hxx>
59 const tools::Long SC_NOTECAPTION_MAXWIDTH_TEMP = 12000;
64 const tools::Long SC_NOTECAPTION_BORDERDIST_TEMP = 100;
71 static void SetCaptionLayer(
SdrCaptionObj& rCaption,
bool bShown );
73 static void SetBasicCaptionSettings(
SdrCaptionObj& rCaption,
bool bShown );
80 void ScCaptionUtil::SetCaptionLayer(
SdrCaptionObj& rCaption,
bool bShown )
87 void ScCaptionUtil::SetBasicCaptionSettings(
SdrCaptionObj& rCaption,
bool bShown )
89 SetCaptionLayer( rCaption, bShown );
98 OSL_ENSURE( pObjData,
"ScCaptionUtil::SetCaptionUserData - missing drawing object user data" );
146 aItemSet.
Put(*pExtraItemSet);
161 class ScCaptionCreator
179 void UpdateCaptionPos();
186 Point CalcTailPos(
bool bTailFront );
188 void CreateCaption(
bool bShown,
bool bTailFront );
205 ScCaptionCreator::ScCaptionCreator(
ScDocument& rDoc,
const ScAddress& rPos,
bool bTailFront ) :
210 CreateCaption(
true, bTailFront );
216 mxCaption( xCaption )
228 SdrPage* ScCaptionCreator::GetDrawPage()
231 return pDrawLayer ? pDrawLayer->
GetPage( static_cast< sal_uInt16 >( maPos.Tab() ) ) :
nullptr;
239 Point aTailPos = mxCaption->GetTailPos();
240 aTailPos.setX( ::std::clamp( aTailPos.X(), rVisRect.
Left(), rVisRect.
Right() ) );
241 aTailPos.setY( ::std::clamp( aTailPos.Y(), rVisRect.
Top(), rVisRect.
Bottom() ) );
242 mxCaption->SetTailPos( aTailPos );
248 aCaptPos.setX( ::std::min< tools::Long >( aCaptPos.X(), rVisRect.
Right() - aCaptRect.
GetWidth() ) );
250 aCaptPos.setX( ::std::max< tools::Long >( aCaptPos.X(), rVisRect.
Left() ) );
252 aCaptPos.setY( ::std::min< tools::Long >( aCaptPos.Y(), rVisRect.
Bottom() - aCaptRect.
GetHeight() ) );
254 aCaptPos.setY( ::std::max< tools::Long >( aCaptPos.Y(), rVisRect.
Top() ) );
256 aCaptRect.
SetPos( aCaptPos );
257 mxCaption->SetLogicRect( aCaptRect );
276 tools::Long nNeededSpaceX = nWidth + SC_NOTECAPTION_CELLDIST;
277 tools::Long nNeededSpaceY = nHeight + SC_NOTECAPTION_CELLDIST;
280 bool bFitsWidthLeft = nNeededSpaceX <= nLeftSpace;
281 bool bFitsWidthRight = nNeededSpaceX <= nRightSpace;
282 bool bFitsWidth = nWidth <= rVisRect.
GetWidth();
285 bool bFitsHeightTop = nNeededSpaceY <= nTopSpace;
286 bool bFitsHeightBottom = nNeededSpaceY <= nBottomSpace;
287 bool bFitsHeight = nHeight <= rVisRect.
GetHeight();
290 bool bFitsLeft = bFitsWidthLeft && bFitsHeight;
291 bool bFitsRight = bFitsWidthRight && bFitsHeight;
292 bool bFitsTop = bFitsWidth && bFitsHeightTop;
293 bool bFitsBottom = bFitsWidth && bFitsHeightBottom;
297 if( bFitsLeft || bFitsRight || (!bFitsTop && !bFitsBottom) )
300 bool bPreferLeft = bFitsLeft && (mbNegPage || !bFitsRight);
301 bool bPreferRight = bFitsRight && (!mbNegPage || !bFitsLeft);
303 if( bPreferLeft || (!bPreferRight && (nLeftSpace > nRightSpace)) )
304 aCaptPos.setX( maCellRect.Left() - SC_NOTECAPTION_CELLDIST - nWidth );
306 aCaptPos.setX( maCellRect.Right() + SC_NOTECAPTION_CELLDIST );
308 aCaptPos.setY( maCellRect.Top() + SC_NOTECAPTION_OFFSET_Y );
313 aCaptPos.setX( maCellRect.Left() + SC_NOTECAPTION_OFFSET_X );
316 aCaptPos.setY( maCellRect.Top() - SC_NOTECAPTION_CELLDIST - nHeight );
318 aCaptPos.setY( maCellRect.Bottom() + SC_NOTECAPTION_CELLDIST );
322 aCaptRect.
SetPos( aCaptPos );
323 mxCaption->SetLogicRect( aCaptRect );
324 FitCaptionToRect( pVisRect );
327 void ScCaptionCreator::UpdateCaptionPos()
332 const Point& rOldTailPos = mxCaption->GetTailPos();
333 Point aTailPos = CalcTailPos(
false );
334 if( rOldTailPos != aTailPos )
338 pDrawLayer->
AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *mxCaption ) );
341 tools::Long nDiffX = (rOldTailPos.X() >= 0) ? (aCaptRect.
Left() - rOldTailPos.X()) : (rOldTailPos.X() - aCaptRect.
Right());
342 if( mbNegPage ) nDiffX = -nDiffX - aCaptRect.
GetWidth();
344 aCaptRect.
SetPos( aTailPos +
Point( nDiffX, nDiffY ) );
346 mxCaption->SetTailPos( aTailPos );
347 mxCaption->SetLogicRect( aCaptRect );
354 if( pCaptData && (maPos != pCaptData->
maStart) )
358 pDrawLayer->
AddCalcUndo( std::make_unique<ScUndoObjData>( mxCaption.get(), pCaptData->
maStart, pCaptData->
maEnd, maPos, pCaptData->
maEnd ) );
364 Point ScCaptionCreator::CalcTailPos(
bool bTailFront )
367 bool bTailLeft = bTailFront != mbNegPage;
368 Point aTailPos = bTailLeft ? maCellRect.TopLeft() : maCellRect.TopRight();
370 if( bTailLeft ) aTailPos.AdjustX(10 );
else aTailPos.AdjustX( -10 );
371 aTailPos.AdjustY(10);
375 void ScCaptionCreator::CreateCaption(
bool bShown,
bool bTailFront )
379 Point aTailPos = CalcTailPos( bTailFront );
382 *mrDoc.GetDrawLayer(),
386 ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
389 void ScCaptionCreator::Initialize()
392 mbNegPage = mrDoc.IsNegativePage( maPos.Tab() );
393 if(
SdrPage* pDrawPage = GetDrawPage() )
404 class ScNoteCaptionCreator :
public ScCaptionCreator
414 ScCaptionCreator( rDoc, rPos )
416 SdrPage* pDrawPage = GetDrawPage();
417 OSL_ENSURE( pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - no drawing page" );
422 CreateCaption( rNoteData.
mbShown,
false );
424 OSL_ENSURE( rNoteData.
mxCaption,
"ScNoteCaptionCreator::ScNoteCaptionCreator - missing caption object" );
428 ScCaptionUtil::SetCaptionUserData( *rNoteData.
mxCaption, rPos );
435 ScCaptionCreator( rDoc, rPos, xCaption )
437 SdrPage* pDrawPage = GetDrawPage();
438 OSL_ENSURE( pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - no drawing page" );
439 OSL_ENSURE( xCaption->
getSdrPageFromSdrObject() == pDrawPage,
"ScNoteCaptionCreator::ScNoteCaptionCreator - wrong drawing page in caption" );
443 ScCaptionUtil::SetCaptionUserData( *xCaption, rPos );
445 ScCaptionUtil::SetBasicCaptionSettings( *xCaption, bShown );
454 mpHead(nullptr),
mpNext(nullptr), mpCaption(nullptr), mbNotOwner(false)
459 mpHead(nullptr),
mpNext(nullptr), mpCaption(p), mbNotOwner(false)
468 mpHead(r.mpHead), mpCaption(r.mpCaption), mbNotOwner(false)
486 : mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbNotOwner(false)
488 r.replaceInList(
this );
489 r.mpCaption =
nullptr;
490 r.mbNotOwner =
false;
502 r.replaceInList(
this );
503 r.mpCaption =
nullptr;
504 r.mbNotOwner =
false;
553 mpFirst(p), mnRefs(1)
572 while (pThat && pThat !=
this && pThat->mpNext !=
this)
574 pThat = pThat->mpNext;
576 if (pThat && pThat !=
this)
578 assert(pThat->mpNext ==
this);
579 pThat->mpNext = pNew;
594 #if OSL_DEBUG_LEVEL > 0
595 oslInterlockedCount
nCount = 0;
598 while (pThat && pThat !=
this && pThat->mpNext !=
this)
602 assert(pThat->mpHead || !pThat->mpNext);
604 pThat = pThat->mpNext;
605 #if OSL_DEBUG_LEVEL > 0
614 #if OSL_DEBUG_LEVEL > 0
621 #if OSL_DEBUG_LEVEL > 0
625 assert(pThat->mpHead || !pThat->mpNext);
629 while ((pThat = pThat->mpNext) !=
nullptr);
632 #if OSL_DEBUG_LEVEL > 0
654 #if OSL_DEBUG_LEVEL > 0
661 assert(pThat->mpCaption != p);
662 pThat = pThat->mpNext;
755 SAL_WARN_IF( !pDrawPage,
"sc.core",
"ScCaptionPtr::removeFromDrawPageAndFree - object without drawing page");
760 bool bRecording =
false;
764 SAL_WARN_IF( !pDrawLayer,
"sc.core",
"ScCaptionPtr::removeFromDrawPageAndFree - object without drawing layer");
766 bRecording = (pDrawLayer && pDrawLayer->
IsRecording());
774 if (!bRecording &&
getRefs() <= 1)
802 assert(!pThat->mpNext || pThat->mpHead);
803 assert(pThat->mpHead == pHead);
833 mbDefaultPosSize( true )
855 maNoteData( rNote.maNoteData )
864 maNoteData( rNoteData )
879 return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *
this,
mnPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos,
maNoteData,
false,
mnPostItId );
921 for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara )
924 aBuffer.append(
'\n' );
925 aBuffer.append(rEngine.
GetText(nPara));
927 return aBuffer.makeStringAndClear();
937 return pEditObj->GetParagraphCount() > 1;
1006 aCreator.UpdateCaptionPos();
1029 "ScPostIt::CreateCaptionFromInitData - note caption should not be created in undo/clip documents" );
1052 OSL_ENSURE( xInitData->mxOutlinerObj || !xInitData->maSimpleText.isEmpty(),
1053 "ScPostIt::CreateCaptionFromInitData - need either outliner para object or simple text" );
1054 if (xInitData->mxOutlinerObj)
1063 if( xInitData->mbDefaultPosSize )
1069 aCreator.AutoPlaceCaption();
1075 tools::Long nPosX = bNegPage ? (aCellRect.
Left() - xInitData->maCaptionOffset.X()) : (aCellRect.
Right() + xInitData->maCaptionOffset.X());
1076 tools::Long nPosY = aCellRect.
Top() + xInitData->maCaptionOffset.Y();
1079 aCreator.FitCaptionToRect();
1089 OSL_ENSURE( !
maNoteData.
mxCaption,
"ScPostIt::CreateCaption - unexpected caption object found" );
1094 OSL_ENSURE( !
mrDoc.
IsUndo(),
"ScPostIt::CreateCaption - note caption should not be created in undo documents" );
1118 aCaptRect.
Move( aDist.X(), aDist.Y() );
1120 aCreator.FitCaptionToRect();
1126 aCreator.AutoPlaceCaption();
1155 SAL_INFO(
"sc.core",
"ScPostIt::RemoveCaption - forgetting one ref");
1162 const OUString& rUserText,
const tools::Rectangle& rVisRect,
bool bTailFront )
1164 OUStringBuffer
aBuffer( rUserText );
1170 if( !aBuffer.isEmpty() )
1171 aBuffer.append(
"\n--------\n" ).append( pNote->
GetText() );
1176 if( !pNoteCaption && aBuffer.isEmpty() )
1181 rVisRect.
Left() + SC_NOTECAPTION_BORDERDIST_TEMP,
1182 rVisRect.
Top() + SC_NOTECAPTION_BORDERDIST_TEMP,
1183 rVisRect.
Right() - SC_NOTECAPTION_BORDERDIST_TEMP,
1184 rVisRect.
Bottom() - SC_NOTECAPTION_BORDERDIST_TEMP );
1187 ScCaptionCreator aCreator( rDoc, rPos, bTailFront );
1190 aCreator.GetCaption().insertToDrawPage( rDrawPage );
1195 if( pNoteCaption && rUserText.isEmpty() )
1207 pCaption->
SetText( aBuffer.makeStringAndClear() );
1208 ScCaptionUtil::SetDefaultItems( *pCaption, rDoc,
nullptr );
1210 tools::Long nMaxWidth = ::std::min< tools::Long >( aVisRect.GetWidth() * 2 / 3, SC_NOTECAPTION_MAXWIDTH_TEMP );
1219 aCreator.AutoPlaceCaption( &aVisRect );
1222 return aCreator.GetCaption();
1233 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1236 ScNoteCaptionCreator aCreator( rDoc, rPos, aNoteData.
mxCaption,
true );
1246 OSL_ENSURE( pItemSet && pOutlinerObj,
"ScNoteUtil::CreateNoteFromObjectData - item set and outliner object expected" );
1248 aNoteData.
mxInitData = std::make_shared<ScCaptionInitData>();
1250 rInitData.mxItemSet = std::move(pItemSet);
1251 rInitData.mxOutlinerObj.reset( pOutlinerObj );
1254 rInitData.mbDefaultPosSize = rCaptionRect.
IsEmpty();
1255 if( !rInitData.mbDefaultPosSize )
1259 rInitData.maCaptionOffset.setX( bNegPage ? (aCellRect.
Left() - rCaptionRect.
Right()) : (rCaptionRect.
Left() - aCellRect.
Right()) );
1260 rInitData.maCaptionOffset.setY( rCaptionRect.
Top() - aCellRect.
Top() );
1261 rInitData.maCaptionSize = rCaptionRect.
GetSize();
1269 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1276 bool bShown,
bool bAlwaysCreateCaption, sal_uInt32 nPostItId )
1279 if( !rNoteText.isEmpty() )
1282 aNoteData.
mxInitData = std::make_shared<ScCaptionInitData>();
1284 rInitData.maSimpleText = rNoteText;
1285 rInitData.mbDefaultPosSize =
true;
1289 pNote =
new ScPostIt( rDoc, rPos, aNoteData, bAlwaysCreateCaption, nPostItId );
1292 rDoc.
SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
1300 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
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.
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)
static ScCaptionPtr CreateTempCaption(ScDocument &rDoc, const ScAddress &rPos, SdrPage &rDrawPage, const OUString &rUserText, const tools::Rectangle &rVisRect, bool bTailFront)
Creates and returns a caption object for a temporary caption.
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.
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Notes.
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
SdrMetricItem makeSdrTextMaxFrameWidthItem(tools::Long mnWidth)
SdrPage * getSdrPageFromSdrObject() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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)
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.
std::unique_ptr< SfxItemSet > mxItemSet
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
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)
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
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
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)
void SetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
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.
std::unique_ptr< OutlinerParaObject > mxOutlinerObj
Caption object formatting.
static ScPostIt * CreateNoteFromObjectData(ScDocument &rDoc, const ScAddress &rPos, std::unique_ptr< SfxItemSet > pItemSet, OutlinerParaObject *pOutlinerObj, const tools::Rectangle &rCaptionRect, bool bShown)
Creates a cell note based on the passed caption object data.
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 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...