32 #include <viewfunc.hxx>
37 #include <docfunc.hxx>
43 #include <drawview.hxx>
54 void collectUIInformation(
const OUString& aevent )
57 aDescription.
aID =
"grid_window";
59 aDescription.
aAction =
"COMMENT";
60 aDescription.
aParent =
"MainWindow";
61 aDescription.
aKeyWord =
"ScGridWinUIObject";
131 SID_CURRENTCELL, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
132 { &aPosItem, &aUnmarkItem });
143 size_t ListSize = aRanges.
size();
144 for (
size_t i = 0;
i < ListSize; ++
i )
153 if (aRangesToMark.
empty())
160 ListSize = aRangesToMark.
size();
161 for (
size_t i = 0;
i < ListSize; ++
i )
180 vector<ScTokenRef> aRefTokens;
183 if (aRefTokens.empty())
193 sal_uInt16 nFileId = p->GetIndex();
200 OUString aTabName = p->GetString().getString();
243 vector<ScTokenRef> aRefTokens;
246 if (aRefTokens.empty())
276 bool bInputMode = (pInputHdl && pInputHdl->
IsInputMode());
285 pCurNumFormatEntry->
GetMaskedType() : SvNumFormatType::UNDEFINED);
290 sal_uInt32 nFormat = 0;
293 case SvNumFormatType::DATE:
297 if (nCurNumFormatType == SvNumFormatType::DATE)
298 nFormat = nCurNumFormat;
301 case SvNumFormatType::TIME:
305 if (nCurNumFormatType == SvNumFormatType::TIME)
306 nFormat = nCurNumFormat;
310 SAL_WARN(
"sc.ui",
"unhandled current date/time request");
311 nReqFmt = SvNumFormatType::DATETIME;
313 case SvNumFormatType::DATETIME:
317 if (nCurNumFormatType == SvNumFormatType::DATETIME)
318 nFormat = nCurNumFormat;
351 bool bForceReqFmt =
false;
352 const double fCell = rDoc.
GetValue( aCurPos);
356 case SvNumFormatType::DATE:
357 switch (nCurNumFormatType)
359 case SvNumFormatType::TIME:
364 nReqFmt = SvNumFormatType::DATETIME;
366 case SvNumFormatType::DATETIME:
373 double fDate = rtl::math::approxFloor( fCell);
381 case SvNumFormatType::TIME:
382 switch (nCurNumFormatType)
384 case SvNumFormatType::DATE:
388 nReqFmt = SvNumFormatType::DATETIME;
390 case SvNumFormatType::DATETIME:
394 nReqFmt = SvNumFormatType::DATETIME;
399 double fDate = rtl::math::approxFloor( fCell);
400 double fTime = fCell - fDate;
402 nReqFmt = SvNumFormatType::DATETIME;
411 SAL_WARN(
"sc.ui",
"unhandled current date/time request");
412 nReqFmt = SvNumFormatType::DATETIME;
414 case SvNumFormatType::DATETIME:
420 case SvNumFormatType::DATE:
426 case SvNumFormatType::TIME:
432 case SvNumFormatType::DATETIME:
433 switch (nCurNumFormatType)
435 case SvNumFormatType::DATE:
437 double fDate = rtl::math::approxFloor( fCell);
442 case SvNumFormatType::TIME:
444 double fTime = fCell - rtl::math::approxFloor( fCell);
446 fVal = (aActDate - pFormatter->
GetNullDate()) + fTime;
471 if (bForceReqFmt || (nReqFmt != nCurNumFormatType && nCurNumFormatType != SvNumFormatType::DATETIME))
525 pScDrawView->SyncForGrid( pCaption );
528 static_cast< FuSelection*
>( pDraw )->ActivateNoteHandles( pCaption );
541 collectUIInformation(
"OPEN");
void BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager)
ScMarkData & GetMarkData()
void DetectiveMarkInvalid()
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
ScDocShell * GetDocShell() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool SC_DLLPUBLIC isExternalRef(const ScTokenRef &pToken)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
void getRangeListFromTokens(const ScDocument *pDoc, ScRangeList &rRangeList, const ::std::vector< ScTokenRef > &pTokens, const ScAddress &rPos)
void SetPasteMode(ScPasteFlags nFlags)
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
SC_DLLPUBLIC void GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt32 &rFormat) const
SC_DLLPUBLIC bool ShowNote(const ScAddress &rPos, bool bShow)
ScDocument & GetDocument() const
Base class for all functions.
const OUString * getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal=false)
It returns a pointer to the name of the URI associated with a given external file ID...
virtual SfxUndoManager * GetUndoManager() override
static UITestLogger & getInstance()
void UpdateCopySourceOverlay()
void logEvent(const EventDescription &rDescription)
void UpdateInputHandler(bool bForce=false)
void DetectiveCollectAllSuccs(const ScRangeList &rSrcRanges,::std::vector< ScTokenRef > &rRefTokens)
void DetectiveCollectAllPreds(const ScRangeList &rSrcRanges,::std::vector< ScTokenRef > &rRefTokens)
Additional class containing cell annotation data.
bool IsMultiMarked() const
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
void push_back(const ScRange &rRange)
bool DetectiveRefresh(bool bAutomatic=false)
ScDrawLayer * MakeDrawLayer()
ScViewData & GetViewData()
void ScrollToObject(const SdrObject *pDrawObj)
void ShowCaptionTemp(const ScAddress &rPos, bool bShow=true)
Shows or hides the caption temporarily (does not change internal visibility state).
Base class for Text functions.
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
ScTabViewShell * GetViewShell() const
bool SetValueCell(const ScAddress &rPos, double fVal, bool bInteraction)
SC_DLLPUBLIC ScPostIt * GetOrCreateNote(const ScAddress &rPos)
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
void MarkAndJumpToRanges(const ScRangeList &rRanges)
bool DetectiveAddPred(const ScAddress &rPos)
bool DetectiveAddError(const ScAddress &rPos)
void SetNumberFormat(SvNumFormatType nFormatType, sal_uLong nAdd=0)
static SC_DLLPUBLIC LanguageType eLnge
Base class for all functions.
static void lcl_jumpToRange(const ScRange &rRange, ScViewData *pView, const ScDocument &rDoc)
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
ScAddress GetCurPos() const
void InsertCurrentTime(SvNumFormatType nCellFmt, const OUString &rUndoStr)
Insert date or time into current cell.
SdrCaptionObj * GetCaption() const
Returns an existing note caption object.
void ShowNote(bool bShow)
ScDrawView * GetScDrawView()
bool DetectiveDelSucc(const ScAddress &rPos)
SfxDispatcher & GetDispatcher()
FuPoor * GetDrawFuncPtr()
::boost::intrusive_ptr< formula::FormulaToken > ScTokenRef
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
static void OnLOKNoteStateChanged(const ScPostIt *pNote)
const ScDocument & GetDocument() const
#define SAL_WARN(area, stream)
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
bool DetectiveAddSucc(const ScAddress &rPos)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool DetectiveDelAll(SCTAB nTab)
std::map< OUString, OUString > aParameters
bool getRangeFromToken(const ScDocument *pDoc, ScRange &rRange, const ScTokenRef &pToken, const ScAddress &rPos, bool bExternal=false)
bool DetectiveDelPred(const ScAddress &rPos)
bool DetectiveMarkInvalid(SCTAB nTab)
ViewShellId GetViewShellId() const override