LibreOffice Module sc (master) 1
|
Additional class containing cell annotation data. More...
#include <postit.hxx>
Public Member Functions | |
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. More... | |
ScPostIt (ScDocument &rDoc, const ScAddress &rPos, const ScPostIt &rNote, sal_uInt32 nPostItId=0) | |
Copy constructor. More... | |
ScPostIt (ScDocument &rDoc, const ScAddress &rPos, ScNoteData aNoteData, bool bAlwaysCreateCaption, sal_uInt32 nPostItId=0) | |
Creates a note from the passed note data with existing caption object. More... | |
~ScPostIt () | |
Removes the caption object from drawing layer, if this note is its owner. More... | |
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. More... | |
sal_uInt32 | GetId () const |
Returns the note id. More... | |
const ScNoteData & | GetNoteData () const |
Returns the data struct containing all note settings. More... | |
const OUString & | GetDate () const |
Returns the creation date of this note. More... | |
void | SetDate (const OUString &rDate) |
Sets a new creation date for this note. More... | |
const OUString & | GetAuthor () const |
Returns the author date of this note. More... | |
void | SetAuthor (const OUString &rAuthor) |
Sets a new author date for this note. More... | |
void | AutoStamp () |
Sets date and author from system settings. More... | |
const OutlinerParaObject * | GetOutlinerObject () const |
Returns the pointer to the current outliner object, or null. More... | |
const EditTextObject * | GetEditTextObject () const |
Returns the pointer to the current edit text object, or null. More... | |
OUString | GetText () const |
Returns the caption text of this note. More... | |
void | SetText (const ScAddress &rPos, const OUString &rText) |
Changes the caption text of this note. More... | |
SdrCaptionObj * | GetCaption () const |
Returns an existing note caption object. More... | |
SdrCaptionObj * | GetOrCreateCaption (const ScAddress &rPos) const |
Returns the caption object of this note. More... | |
void | ForgetCaption (bool bPreserveData=false) |
Forgets the pointer to the note caption object. More... | |
void | ShowCaption (const ScAddress &rPos, bool bShow) |
Shows or hides the note caption object. More... | |
bool | IsCaptionShown () const |
Returns true, if the caption object is visible. More... | |
void | ShowCaptionTemp (const ScAddress &rPos, bool bShow=true) |
Shows or hides the caption temporarily (does not change internal visibility state). More... | |
void | UpdateCaptionPos (const ScAddress &rPos) |
Updates caption position according to position of the passed cell. More... | |
Static Public Attributes | |
static sal_uInt32 | mnLastPostItId = 1 |
Private Member Functions | |
ScPostIt (const ScPostIt &)=delete | |
ScPostIt & | operator= (const ScPostIt &)=delete |
void | CreateCaptionFromInitData (const ScAddress &rPos) const |
Creates the caption object from initial caption data if existing. More... | |
void | CreateCaption (const ScAddress &rPos, const SdrCaptionObj *pCaption=nullptr) |
Creates a new caption object at the passed cell position, clones passed existing caption. More... | |
void | RemoveCaption () |
Removes the caption object from the drawing layer, if this note is its owner. More... | |
Private Attributes | |
ScDocument & | mrDoc |
ScNoteData | maNoteData |
Parent document containing the note. More... | |
sal_uInt32 | mnPostItId |
Note data with pointer to caption object. More... | |
Additional class containing cell annotation data.
Definition at line 57 of file postit.hxx.
|
explicit |
Creates an empty note and its caption object and places it according to the passed cell position.
Definition at line 452 of file postit.cxx.
References AutoStamp(), CreateCaption(), mnLastPostItId, and mnPostItId.
|
explicit |
Copy constructor.
Clones the note and its caption to a new document.
Definition at line 461 of file postit.cxx.
References CreateCaption(), maNoteData, mnLastPostItId, mnPostItId, and ScNoteData::mxCaption.
|
explicit |
Creates a note from the passed note data with existing caption object.
bAlwaysCreateCaption | Instead of a pointer to an existing caption object, the passed note data structure may contain a reference to an ScCaptionInitData structure containing information about how to construct a missing caption object. If sal_True is passed, the caption drawing object will be created immediately from that data. If sal_False is passed and the note is not visible, it will continue to cache that data until the caption object is requested. |
Definition at line 470 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, ScNoteData::mbShown, mnLastPostItId, and mnPostItId.
ScPostIt::~ScPostIt | ( | ) |
Removes the caption object from drawing layer, if this note is its owner.
Definition at line 479 of file postit.cxx.
References RemoveCaption().
|
privatedelete |
void ScPostIt::AutoStamp | ( | ) |
Sets date and author from system settings.
Definition at line 504 of file postit.cxx.
References LocaleDataWrapper::getDate(), ScGlobal::getLocaleData(), LocaleDataWrapper::getTime(), ScNoteData::maAuthor, ScNoteData::maDate, maNoteData, ScResId(), Date::SYSTEM, and DateTime::SYSTEM.
Referenced by ScNoteUtil::CreateNoteFromCaption(), ScNoteUtil::CreateNoteFromObjectData(), ScNoteUtil::CreateNoteFromString(), ScPostIt(), and FuText::StopEditMode().
std::unique_ptr< ScPostIt > ScPostIt::Clone | ( | const ScAddress & | rOwnPos, |
ScDocument & | rDestDoc, | ||
const ScAddress & | rDestPos, | ||
bool | bCloneCaption | ||
) | const |
Clones this note and its caption object, if specified.
bCloneCaption | If sal_True is passed, clones the caption object and inserts it into the drawing layer of the destination document. If sal_False is passed, the cloned note will refer to the old caption object (used e.g. in Undo documents to restore the pointer to the existing caption object). |
Definition at line 484 of file postit.cxx.
References CreateCaptionFromInitData(), comphelper::LibreOfficeKit::isActive(), ScDocument::IsClipboard(), maNoteData, mnPostItId, and mrDoc.
Referenced by ScColumn::CopyCellToDocument(), ScColumn::CopyOneCellFromClip(), and ScTable::TransposeColNotes().
|
private |
Creates a new caption object at the passed cell position, clones passed existing caption.
Definition at line 707 of file postit.cxx.
References ScDrawLayer::AddCalcUndo(), ScStyleSheetPool::CopyStyleFrom(), SfxStyleSheetBasePool::Find(), ScDocument::GetDrawLayer(), SdrCaptionObj::GetLogicRect(), SdrObject::GetMergedItemSet(), SdrTextObj::GetOutlinerParaObject(), SdrObject::GetStyleSheet(), ScDocument::GetStyleSheetPool(), SdrCaptionObj::GetTailPos(), ScDocument::InitDrawLayer(), ScDocument::IsClipboard(), ScDrawLayer::IsRecording(), ScDocument::IsUndo(), maNoteData, tools::Rectangle::Move(), mrDoc, ScNoteData::mxCaption, ScResId(), tools::Rectangle::SetSize(), Point::X(), and Point::Y().
Referenced by ScPostIt().
|
private |
Creates the caption object from initial caption data if existing.
Definition at line 617 of file postit.cxx.
References SfxStyleSheetBasePool::Find(), ScDrawLayer::GetCellRect(), ScDocument::GetStyleSheetPool(), ScDocument::InitDrawLayer(), ScDocument::IsClipboard(), ScDocument::IsNegativePage(), ScDocument::IsUndo(), tools::Rectangle::Left(), makeSdrTextMaxFrameWidthItem(), makeSdrTextMinFrameWidthItem(), maNoteData, mrDoc, ScNoteData::mxCaption, ScNoteData::mxInitData, tools::Rectangle::Right(), ScResId(), ScAddress::Tab(), and tools::Rectangle::Top().
Referenced by Clone(), GetOrCreateCaption(), ScPostIt(), SetText(), ShowCaption(), ShowCaptionTemp(), and UpdateCaptionPos().
void ScPostIt::ForgetCaption | ( | bool | bPreserveData = false | ) |
Forgets the pointer to the note caption object.
bPreserveData | If true then the note text is remembered in maNoteData to be able to later reconstruct a caption from it. |
Definition at line 561 of file postit.cxx.
References GetOutlinerObject(), GetText(), maNoteData, ScCaptionInitData::maSimpleText, ScNoteData::mxCaption, ScNoteData::mxInitData, and ScCaptionInitData::mxOutlinerObj.
|
inline |
Returns the author date of this note.
Definition at line 111 of file postit.hxx.
Referenced by ScNoteUtil::CreateTempCaption(), ScXMLExport::exportAnnotationMeta(), ScAnnotationObj::getAuthor(), ScDocShell::LOKCommentNotify(), and XclExpNote::XclExpNote().
|
inline |
Returns an existing note caption object.
returns null, if the note contains initial caption data needed to construct a caption object. The SdrCaptionObj* returned is still managed by the underlying ScNoteData::ScCaptionPtr and must not be stored elsewhere.
Definition at line 132 of file postit.hxx.
Referenced by ScViewFunc::EditNote(), lcl_UnLockComment(), ScTabView::OnLOKNoteStateChanged(), ScDocFunc::ShowNote(), and FuText::StopEditMode().
|
inline |
Returns the creation date of this note.
Definition at line 106 of file postit.hxx.
Referenced by ScNoteUtil::CreateTempCaption(), ScXMLExport::exportAnnotationMeta(), ScAnnotationObj::getDate(), and ScDocShell::LOKCommentNotify().
const EditTextObject * ScPostIt::GetEditTextObject | ( | ) | const |
Returns the pointer to the current edit text object, or null.
Definition at line 521 of file postit.cxx.
References GetOutlinerObject(), and OutlinerParaObject::GetTextObject().
Referenced by GetText(), and XclExpNote::XclExpNote().
|
inline |
Returns the note id.
Definition at line 100 of file postit.hxx.
Referenced by ScDocShell::LOKCommentNotify().
|
inline |
Returns the data struct containing all note settings.
Definition at line 103 of file postit.hxx.
Referenced by ScDocFunc::ReplaceNote(), and FuText::StopEditMode().
SdrCaptionObj * ScPostIt::GetOrCreateCaption | ( | const ScAddress & | rPos | ) | const |
Returns the caption object of this note.
Creates the caption object, if the note contains initial caption data instead of the caption. The SdrCaptionObj* returned is still managed by the underlying ScNoteData::ScCaptionPtr and must not be stored elsewhere.
Definition at line 555 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, and ScNoteData::mxCaption.
Referenced by ScXMLExport::collectAutoStyles(), ScNoteUtil::CreateTempCaption(), ScXMLExport::exportAnnotationMeta(), oox::xls::Comment::finalizeImport(), ScAnnotationEditSource::GetCaptionObj(), ScXMLExport::WriteAnnotation(), and XclExpNote::XclExpNote().
const OutlinerParaObject * ScPostIt::GetOutlinerObject | ( | ) | const |
Returns the pointer to the current outliner object, or null.
Definition at line 512 of file postit.cxx.
References maNoteData, ScNoteData::mxCaption, and ScNoteData::mxInitData.
Referenced by ForgetCaption(), and GetEditTextObject().
OUString ScPostIt::GetText | ( | ) | const |
Returns the caption text of this note.
Definition at line 527 of file postit.cxx.
References aBuffer, GetEditTextObject(), ScDocument::GetNoteEngine(), EditEngine::GetParagraphCount(), EditEngine::GetText(), maNoteData, mrDoc, ScNoteData::mxInitData, and ScEditEngineDefaulter::SetTextCurrentDefaults().
Referenced by ScOutputData::AddPDFNotes(), sc::SearchResultsDlg::FillResults(), ForgetCaption(), ScGridWinUIObject::get_state(), lcl_NoteString(), ScDocShell::LOKCommentNotify(), ScTable::SearchCell(), ScHTMLExport::WriteCell(), and XclExpNote::XclExpNote().
|
inline |
Returns true, if the caption object is visible.
Definition at line 150 of file postit.hxx.
Referenced by ScNoteUtil::CreateTempCaption(), ScAnnotationObj::getIsVisible(), ScCellShell::GetState(), ScDocFunc::ShowNote(), ScGridWindow::ShowNoteMarker(), and ScXMLExport::WriteAnnotation().
|
private |
Removes the caption object from the drawing layer, if this note is its owner.
Definition at line 769 of file postit.cxx.
References ScDrawLayer::AddCalcUndo(), ScDocument::GetDrawLayer(), ScDocument::IsClipboard(), ScDocument::IsInDtorClear(), ScDrawLayer::IsRecording(), ScDocument::IsUndo(), maNoteData, mrDoc, ScNoteData::mxCaption, SdrObjList::RecalcObjOrdNums(), SdrObjList::RemoveObject(), SAL_INFO, and SAL_WARN_IF.
Referenced by ~ScPostIt().
void ScPostIt::SetAuthor | ( | const OUString & | rAuthor | ) |
Sets a new author date for this note.
Definition at line 499 of file postit.cxx.
References ScNoteData::maAuthor, and maNoteData.
Referenced by ScDocFunc::ReplaceNote(), and ScXMLTableRowCellContext::SetAnnotation().
void ScPostIt::SetDate | ( | const OUString & | rDate | ) |
Sets a new creation date for this note.
Definition at line 494 of file postit.cxx.
References ScNoteData::maDate, and maNoteData.
Referenced by ScDocFunc::ReplaceNote(), and ScXMLTableRowCellContext::SetAnnotation().
void ScPostIt::SetText | ( | const ScAddress & | rPos, |
const OUString & | rText | ||
) |
Changes the caption text of this note.
All text formatting will be lost.
Definition at line 548 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, and ScNoteData::mxCaption.
Referenced by ScGridWinUIObject::execute(), ScTable::SearchCell(), and ScUndoReplace::Undo().
void ScPostIt::ShowCaption | ( | const ScAddress & | rPos, |
bool | bShow | ||
) |
Shows or hides the note caption object.
Definition at line 589 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, ScNoteData::mbShown, and ScNoteData::mxCaption.
Referenced by ScDocFunc::ShowNote().
void ScPostIt::ShowCaptionTemp | ( | const ScAddress & | rPos, |
bool | bShow = true |
||
) |
Shows or hides the caption temporarily (does not change internal visibility state).
Definition at line 598 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, ScNoteData::mbShown, and ScNoteData::mxCaption.
Referenced by ScViewFunc::EditNote(), and FuText::StopEditMode().
void ScPostIt::UpdateCaptionPos | ( | const ScAddress & | rPos | ) |
Updates caption position according to position of the passed cell.
Definition at line 605 of file postit.cxx.
References CreateCaptionFromInitData(), maNoteData, mrDoc, and ScNoteData::mxCaption.
Referenced by ScColumn::CopyCellToDocument().
|
mutableprivate |
Parent document containing the note.
Definition at line 171 of file postit.hxx.
Referenced by AutoStamp(), Clone(), CreateCaption(), CreateCaptionFromInitData(), ForgetCaption(), GetOrCreateCaption(), GetOutlinerObject(), GetText(), RemoveCaption(), ScPostIt(), SetAuthor(), SetDate(), SetText(), ShowCaption(), ShowCaptionTemp(), and UpdateCaptionPos().
|
static |
Definition at line 60 of file postit.hxx.
Referenced by ScPostIt().
|
private |
Note data with pointer to caption object.
Definition at line 172 of file postit.hxx.
Referenced by Clone(), and ScPostIt().
|
private |
Definition at line 170 of file postit.hxx.
Referenced by Clone(), CreateCaption(), CreateCaptionFromInitData(), GetText(), RemoveCaption(), and UpdateCaptionPos().