LibreOffice Module sc (master) 1
Static Public Member Functions | List of all members
ScNoteUtil Class Reference

#include <postit.hxx>

Static Public Member Functions

static rtl::Reference< SdrCaptionObjCreateTempCaption (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. More...
 
static ScPostItCreateNoteFromCaption (ScDocument &rDoc, const ScAddress &rPos, SdrCaptionObj *pCaption, bool bHasStyle)
 Creates a cell note using the passed caption drawing object. More...
 
static ScPostItCreateNoteFromObjectData (ScDocument &rDoc, const ScAddress &rPos, SfxItemSet &&oItemSet, const OUString &rStyleName, const OutlinerParaObject &rOutlinerObj, const tools::Rectangle &rCaptionRect, bool bShown)
 Creates a cell note based on the passed caption object data. More...
 
static ScPostItCreateNoteFromString (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. More...
 

Detailed Description

Definition at line 175 of file postit.hxx.

Member Function Documentation

◆ CreateNoteFromCaption()

ScPostIt * ScNoteUtil::CreateNoteFromCaption ( ScDocument rDoc,
const ScAddress rPos,
SdrCaptionObj pCaption,
bool  bHasStyle 
)
static

Creates a cell note using the passed caption drawing object.

This function is used in import filters to reuse the imported drawing object as note caption object.

Parameters
pCaptionThe drawing object for the cell note. This object MUST be inserted into the document at the correct drawing page already. The underlying ScPostIt::ScNoteData::ScCaptionPtr takes managing ownership of the pointer.
bHasStyleIs there a drawing style set for the note.
Returns
Pointer to the new cell note object if insertion was successful (i.e. the passed cell position was valid), null otherwise. The Calc document is the owner of the note object. The passed item set and outliner object are deleted automatically if creation of the note was not successful.

Definition at line 905 of file postit.cxx.

References ScPostIt::AutoStamp(), SfxStyleSheetBasePool::Find(), ScDocument::GetStyleSheetPool(), ScNoteData::mxCaption, ScResId(), SDRATTR_SHADOW(), and ScDocument::SetNote().

Referenced by ScXMLTableRowCellContext::SetAnnotation().

◆ CreateNoteFromObjectData()

ScPostIt * ScNoteUtil::CreateNoteFromObjectData ( ScDocument rDoc,
const ScAddress rPos,
SfxItemSet &&  oItemSet,
const OUString &  rStyleName,
const OutlinerParaObject rOutlinerObj,
const tools::Rectangle rCaptionRect,
bool  bShown 
)
static

Creates a cell note based on the passed caption object data.

This function is used in import filters to use an existing imported item set and outliner object to create a note caption object. For performance reasons, it is possible to specify that the caption drawing object for the cell note is not created yet but the note caches the passed data needed to create the caption object on demand (see parameter bAlwaysCreateCaption).

Parameters
pItemSetPointer to an item set on heap memory containing all formatting attributes of the caption object. This function takes ownership of the passed item set.
rStyleNameDrawing style associated with the caption object.
rOutlinerObjAn outliner object containing (formatted) text for the caption object.
rCaptionRectThe absolute position and size of the caption object. The rectangle may be empty, in this case the default position and size is used.
Returns
Pointer to the new cell note object if insertion was successful (i.e. the passed cell position was valid), null otherwise. The Calc document is the owner of the note object.

Definition at line 932 of file postit.cxx.

References ScPostIt::AutoStamp(), ScDrawLayer::GetCellRect(), tools::Rectangle::GetSize(), tools::Rectangle::IsEmpty(), ScDocument::IsNegativePage(), tools::Rectangle::Left(), ScCaptionInitData::maCaptionOffset, ScCaptionInitData::maCaptionSize, ScCaptionInitData::maStyleName, ScCaptionInitData::mbDefaultPosSize, ScCaptionInitData::moItemSet, ScNoteData::mxInitData, ScCaptionInitData::mxOutlinerObj, ScStyleNameConversion::ProgrammaticToDisplayName(), tools::Rectangle::Right(), ScDocument::SetNote(), Point::setX(), Point::setY(), ScAddress::Tab(), and tools::Rectangle::Top().

Referenced by XclImpNoteObj::DoPreProcessSdrObj(), and ScXMLTableRowCellContext::SetAnnotation().

◆ CreateNoteFromString()

ScPostIt * ScNoteUtil::CreateNoteFromString ( ScDocument rDoc,
const ScAddress rPos,
const OUString &  rNoteText,
bool  bShown,
bool  bAlwaysCreateCaption,
sal_uInt32  nPostItId = 0 
)
static

Creates a cell note based on the passed string and inserts it into the document.

Parameters
rNoteTextThe text used to create the note caption object. Must not be empty.
bAlwaysCreateCaptionIf sal_True is passed, the caption drawing object will be created immediately. If sal_False is passed, the caption drawing object will not be created if the note is not visible (bShown = sal_False), but the cell note will cache the passed data. MUST be set to sal_False outside of import filter implementations!
Returns
Pointer to the new cell note object if insertion was successful (i.e. the passed cell position was valid), null otherwise. The Calc document is the owner of the note object.

Definition at line 965 of file postit.cxx.

References ScPostIt::AutoStamp(), ScCaptionInitData::maSimpleText, ScCaptionInitData::maStyleName, ScCaptionInitData::mbDefaultPosSize, ScNoteData::mxInitData, ScResId(), and ScDocument::SetNote().

Referenced by ScDocFunc::ImportNote(), OP_Note123(), XclImpSheetDrawing::ReadNote3(), ScDocFunc::ReplaceNote(), and ScXMLTableRowCellContext::SetAnnotation().

◆ CreateTempCaption()

rtl::Reference< SdrCaptionObj > ScNoteUtil::CreateTempCaption ( ScDocument rDoc,
const ScAddress rPos,
SdrPage rDrawPage,
std::u16string_view  rUserText,
const tools::Rectangle rVisRect,
bool  bTailFront 
)
static

The documentation for this class was generated from the following files: