32#include <rtl/math.hxx>
35#include <viewfunc.hxx>
46#include <drawview.hxx>
58void collectUIInformation(
const OUString& aevent )
61 aDescription.
aID =
"grid_window";
63 aDescription.
aAction =
"COMMENT";
64 aDescription.
aParent =
"MainWindow";
65 aDescription.
aKeyWord =
"ScGridWinUIObject";
135 SID_CURRENTCELL, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
136 { &aPosItem, &aUnmarkItem });
147 size_t ListSize = aRanges.
size();
148 for (
size_t i = 0;
i < ListSize; ++
i )
157 if (aRangesToMark.
empty())
164 ListSize = aRangesToMark.
size();
165 for (
size_t i = 0;
i < ListSize; ++
i )
184 vector<ScTokenRef> aRefTokens;
187 if (aRefTokens.empty())
197 sal_uInt16 nFileId =
p->GetIndex();
204 OUString aTabName =
p->GetString().getString();
247 vector<ScTokenRef> aRefTokens;
250 if (aRefTokens.empty())
280 bool bInputMode = (pInputHdl && pInputHdl->
IsInputMode());
289 pCurNumFormatEntry->
GetMaskedType() : SvNumFormatType::UNDEFINED);
311 sal_uInt32 nFormat = 0;
314 case SvNumFormatType::DATE:
318 if (nCurNumFormatType == SvNumFormatType::DATE)
319 nFormat = nCurNumFormat;
322 case SvNumFormatType::TIME:
326 if (nCurNumFormatType == SvNumFormatType::TIME)
327 nFormat = nCurNumFormat;
331 SAL_WARN(
"sc.ui",
"unhandled current date/time request");
332 nReqFmt = SvNumFormatType::DATETIME;
334 case SvNumFormatType::DATETIME:
338 if (nCurNumFormatType == SvNumFormatType::DATETIME)
339 nFormat = nCurNumFormat;
372 bool bForceReqFmt =
false;
373 const double fCell = rDoc.
GetValue( aCurPos);
377 case SvNumFormatType::DATE:
378 switch (nCurNumFormatType)
380 case SvNumFormatType::TIME:
385 nReqFmt = SvNumFormatType::DATETIME;
387 case SvNumFormatType::DATETIME:
394 double fDate = rtl::math::approxFloor( fCell);
402 case SvNumFormatType::TIME:
403 switch (nCurNumFormatType)
405 case SvNumFormatType::DATE:
409 nReqFmt = SvNumFormatType::DATETIME;
411 case SvNumFormatType::DATETIME:
415 nReqFmt = SvNumFormatType::DATETIME;
420 double fDate = rtl::math::approxFloor( fCell);
421 double fTime = fCell - fDate;
423 nReqFmt = SvNumFormatType::DATETIME;
432 SAL_WARN(
"sc.ui",
"unhandled current date/time request");
433 nReqFmt = SvNumFormatType::DATETIME;
435 case SvNumFormatType::DATETIME:
441 case SvNumFormatType::DATE:
447 case SvNumFormatType::TIME:
453 case SvNumFormatType::DATETIME:
454 switch (nCurNumFormatType)
456 case SvNumFormatType::DATE:
458 double fDate = rtl::math::approxFloor( fCell);
463 case SvNumFormatType::TIME:
465 double fTime = fCell - rtl::math::approxFloor( fCell);
467 fVal = (aActDate - pFormatter->
GetNullDate()) + fTime;
489 if (bForceReqFmt || (nReqFmt != nCurNumFormatType && nCurNumFormatType != SvNumFormatType::DATETIME))
543 pScDrawView->SyncForGrid( pCaption );
556 collectUIInformation(
"OPEN");
static double Sub(const DateTime &rDateTime1, const DateTime &rDateTime2)
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
Base class for Text functions.
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
bool DetectiveAddError(const ScAddress &rPos)
bool DetectiveAddPred(const ScAddress &rPos)
bool SetValueCell(const ScAddress &rPos, double fVal, bool bInteraction)
SC_DLLPUBLIC bool ShowNote(const ScAddress &rPos, bool bShow)
bool DetectiveMarkInvalid(SCTAB nTab)
bool DetectiveDelPred(const ScAddress &rPos)
bool DetectiveDelSucc(const ScAddress &rPos)
bool DetectiveDelAll(SCTAB nTab)
bool DetectiveRefresh(bool bAutomatic=false)
void DetectiveCollectAllPreds(const ScRangeList &rSrcRanges, ::std::vector< ScTokenRef > &rRefTokens)
bool DetectiveAddSucc(const ScAddress &rPos)
void DetectiveCollectAllSuccs(const ScRangeList &rSrcRanges, ::std::vector< ScTokenRef > &rRefTokens)
const ScDocument & GetDocument() const
ScDrawLayer * MakeDrawLayer()
virtual SfxUndoManager * GetUndoManager() override
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC ScPostIt * GetOrCreateNote(const ScAddress &rPos)
void BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager)
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.
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
static SC_DLLPUBLIC LanguageType eLnge
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool IsMultiMarked() const
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
Additional class containing cell annotation data.
void ShowCaptionTemp(const ScAddress &rPos, bool bShow=true)
Shows or hides the caption temporarily (does not change internal visibility state).
SdrCaptionObj * GetCaption() const
Returns an existing note caption object.
void push_back(const ScRange &rRange)
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...
FuPoor * GetDrawFuncPtr()
void ScrollToObject(const SdrObject *pDrawObj)
static void OnLOKNoteStateChanged(const ScPostIt *pNote)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
ScViewData & GetViewData()
void UpdateCopySourceOverlay()
ScDrawView * GetScDrawView()
SfxDispatcher & GetDispatcher()
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
void UpdateInputHandler(bool bForce=false)
ScDocShell * GetDocShell() const
ScTabViewShell * GetViewShell() const
void SetPasteMode(ScPasteFlags nFlags)
ScAddress GetCurPos() const
void MarkAndJumpToRanges(const ScRangeList &rRanges)
void DetectiveMarkInvalid()
void SetNumberFormat(SvNumFormatType nFormatType, sal_uLong nAdd=0)
void ShowNote(bool bShow)
void InsertCurrentTime(SvNumFormatType nCellFmt, const OUString &rUndoStr)
Insert date or time into current cell.
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * >())
static std::pair< bool, OUString > getViewTimezone(int nId)
static std::pair< bool, OUString > getDefaultTimezone()
static int getView(const SfxViewShell *pViewShell=nullptr)
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
ViewShellId GetViewShellId() const override
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
#define SAL_WARN(area, stream)
void getRangeListFromTokens(const ScDocument *pDoc, ScRangeList &rRangeList, const ::std::vector< ScTokenRef > &pTokens, const ScAddress &rPos)
bool getRangeFromToken(const ScDocument *pDoc, ScRange &rRange, const ScTokenRef &pToken, const ScAddress &rPos, bool bExternal=false)
bool SC_DLLPUBLIC isExternalRef(const ScTokenRef &pToken)
void setTimezone(bool isSet, const OUString &rTimezone)
std::map< OUString, OUString > aParameters
::boost::intrusive_ptr< formula::FormulaToken > ScTokenRef
static void lcl_jumpToRange(const ScRange &rRange, ScViewData *pView, const ScDocument &rDoc)