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

#include <postit.hxx>

Static Public Member Functions

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. More...
 
static ScPostItCreateNoteFromCaption (ScDocument &rDoc, const ScAddress &rPos, SdrCaptionObj *pCaption)
 Creates a cell note using the passed caption drawing object. More...
 
static ScPostItCreateNoteFromObjectData (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. 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 280 of file postit.hxx.

Member Function Documentation

ScPostIt * ScNoteUtil::CreateNoteFromCaption ( ScDocument rDoc,
const ScAddress rPos,
SdrCaptionObj pCaption 
)
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.
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 1225 of file postit.cxx.

References ScPostIt::AutoStamp(), ScNoteData::mxCaption, ScCaptionPtr::reset(), and ScDocument::SetNote().

Referenced by ScXMLTableRowCellContext::SetAnnotation().

ScPostIt * ScNoteUtil::CreateNoteFromObjectData ( ScDocument rDoc,
const ScAddress rPos,
std::unique_ptr< SfxItemSet pItemSet,
OutlinerParaObject pOutlinerObj,
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.
pOutlinerObjPointer to an outliner object on heap memory containing (formatted) text for the caption object. This function takes ownership of the passed outliner 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 1241 of file postit.cxx.

References ScPostIt::AutoStamp(), ScDrawLayer::GetCellRect(), tools::Rectangle::GetSize(), tools::Rectangle::IsEmpty(), ScDocument::IsNegativePage(), tools::Rectangle::Left(), ScNoteData::mxInitData, tools::Rectangle::Right(), ScDocument::SetNote(), ScAddress::Tab(), and tools::Rectangle::Top().

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

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 1274 of file postit.cxx.

References ScPostIt::AutoStamp(), ScNoteData::mxInitData, and ScDocument::SetNote().

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

ScCaptionPtr ScNoteUtil::CreateTempCaption ( ScDocument rDoc,
const ScAddress rPos,
SdrPage rDrawPage,
const OUString &  rUserText,
const tools::Rectangle rVisRect,
bool  bTailFront 
)
static

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