24 #include <document.hxx>
28 #include <globstr.hrc>
58 if ( nEndX != nStartX || nEndY != nStartY )
60 bool bLeft = ( nEndX < nStartX );
61 bool bTop = ( nEndY < nStartY );
64 SCCOL nCols = nEndX+1-nStartX;
65 SCROW nRows = nEndY+1-nStartY;
67 OUString aHelp =
ScResId( STR_QUICKHELP_REF );
68 aHelp = aHelp.replaceFirst(
"%1", OUString::number(nRows) );
69 aHelp = aHelp.replaceFirst(
"%2", OUString::number(nCols) );
78 Point aPos( bLeft ? aStart.X() : ( aEnd.X() + 3 ),
79 bTop ? aStart.Y() : ( aEnd.Y() + 3 ) );
80 QuickHelpFlags nFlags = ( bLeft ? QuickHelpFlags::Right : QuickHelpFlags::Left ) |
81 ( bTop ? QuickHelpFlags::Bottom : QuickHelpFlags::Top );
89 nFlags = ( nFlags & ~
QuickHelpFlags::Top ) | QuickHelpFlags::Bottom;
130 if ( nStartX == nEndX && nStartY == nEndY )
146 pGridWin[eNew]->GetOutputSizePixel()) );
179 if ( nStartX == nEndX && nStartY == nEndY )
212 if ( nStartX == nEndX && nStartY == nEndY )
213 rDoc.
ExtendMerge( nStartX, nStartY, nEndX, nEndY, nTab );
222 if ( nStartX == nEndX && nStartY == nEndY )
223 rDoc.
ExtendMerge( nStartX, nStartY, nEndX, nEndY, nTab );
224 aRect.
SetNew( nStartX, nStartY, nEndX, nEndY );
232 SC_MOD()->SetReference( aRef, rDoc, &rMark );
249 if (aRect.
GetDiff( nPaintStartX, nPaintStartY, nPaintEndX, nPaintEndY ))
275 aHelpStr =
ScResId( STR_TIP_RESIZEMATRIX );
278 aHelpStr = aHelpStr.replaceFirst(
"%1", OUString::number(nRows) );
279 aHelpStr = aHelpStr.replaceFirst(
"%2", OUString::number(nCols) );
282 aHelpStr =
ScResId( STR_QUICKHELP_DELETE );
283 else if ( nEndX != aMarkRange.
aEnd.
Col() || nEndY != aMarkRange.
aEnd.
Row() )
286 if (!aHelpStr.getLength())
290 SCCOL nAddX = ( nEndX >= aMarkRange.
aEnd.
Col() ) ? 1 : 0;
291 SCROW nAddY = ( nEndY >= aMarkRange.
aEnd.
Row() ) ? 1 : 0;
322 SCCOL nStartX = nCurX;
323 SCROW nStartY = nCurY;
332 ScRange aRef( nCurX,nCurY,nCurZ, nCurX,nCurY,nCurZ );
333 SC_MOD()->SetReference( aRef, rDoc, &rMark );
368 rScroll.
SetPageSize( static_cast<tools::Long>(nSize) );
374 return nNewPos - nOldPos;
383 SCCOLROW nEnd = std::max(nDocEnd, static_cast<SCCOLROW>(nPos+nVis)) + nVis;
387 return ( nEnd - nStart );
461 SC_MOD()->AnythingChanged();
465 #ifndef HDR_SLIDERSIZE
466 #define HDR_SLIDERSIZE 2
471 for (sal_uInt16
i=0;
i<4;
i++)
472 if (
WhichV(static_cast<ScSplitPos>(
i))==eWhich)
486 for (sal_uInt16
i=0;
i<4;
i++)
487 if (
WhichH(static_cast<ScSplitPos>(
i))==eWhich)
509 for (sal_uInt16
i=0;
i<4;
i++)
ScMarkData & GetMarkData()
virtual void EnableRTL(bool bEnable=true) override
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
void InvertVertical(ScHSplitPos eWhich, tools::Long nDragPos)
SCCOL SanitizeCol(SCCOL nCol) const
ScDocShell * GetDocShell() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
ScRefType GetRefType() const
ScVSplitPos WhichV(ScSplitPos ePos)
static tools::Long lcl_GetScrollRange(SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, SCCOLROW nMax, SCCOLROW nStart)
constexpr sal_uInt16 KEY_MOD1
OUString ScResId(TranslateId aId)
VclPtr< ScrollBar > aHScrollLeft
static tools::Long GetScrollBarPos(const ScrollBar &rScroll)
VclPtr< ScrollBar > aVScrollBottom
bool GetDelMark(ScRange &rRange) const
VclPtr< ScrollBar > aHScrollRight
void DoneRefMode(bool bContinue=false)
SCROW GetRefStartY() const
ScHSplitPos WhichH(ScSplitPos ePos)
void AddRefEntry()
Multiple selection.
void SetDocumentModified()
bool HasEditView(ScSplitPos eWhich) const
ScSplitPos GetActivePart() const
ScDocument & GetDocument() const
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
VclPtr< vcl::Window > sTopParent
void ScrollX(tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars=true)
constexpr tools::Long Width() const
static tools::Long lcl_UpdateBar(ScrollBar &rScroll, SCCOLROW nSize)
void InvertHorizontal(ScVSplitPos eWhich, tools::Long nDragPos)
SC_DLLPUBLIC SCROW MaxRow() const
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
void UpdateShrinkOverlay()
void SetNew(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2)
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
ScSplitMode GetHSplitMode() const
ScViewData & GetViewData()
ScGridWindow * GetActiveWin()
void SetRefStart(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
void PutInOrder(T &nStart, T &nEnd)
void PaintArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScUpdateMode eMode=ScUpdateMode::All)
SC_DLLPUBLIC SCCOL MaxCol() const
static void HidePopover(vcl::Window const *pParent, void *nId)
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
bool GetDiff(SCCOL &rX1, SCROW &rY1, SCCOL &rX2, SCROW &rY2)
static bool IsQuickHelpEnabled()
OUString GetAutoFillPreview(const ScRange &rSource, SCCOL nEndX, SCROW nEndY)
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
void SetRefMode(bool bNewMode, ScRefType eNewType)
VclPtr< ScrollBar > aVScrollTop
static void notifyAllViewsHeaderInvalidation(const SfxViewShell *pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex...
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
SCCOL GetRefStartX() const
SCROW SanitizeRow(SCROW nRow) const
SCTAB GetRefStartZ() const
void SetEmbedded(const ScRange &rRange)
void UpdateOle(const ScViewData &rViewData, bool bSnapSize=false)
ScFillMode GetFillMode() const
tools::Rectangle aTipRectangle
SC_DLLPUBLIC bool GetTableArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bCalcHiddens=false) const
constexpr tools::Long Height() const
bool UpdateVisibleRange()
sal_uInt16 nScFillModeMouseModifier
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
void InterpretDirtyCells(const ScRangeList &rRanges)
ScRefType
Mouse mode to select areas.
SCROW GetEditViewRow() const
void SetRefEnd(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
std::unique_ptr< ScViewSelectionEngine > pSelEngine
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Size GetOutputSizePixel() const
void DoInvertRect(const tools::Rectangle &rPixel)
Point OutputToScreenPixel(const Point &rPos) const
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
ScSplitMode GetVSplitMode() const
SC_DLLPUBLIC bool GetAutoCalc() const
static void SetScrollBar(ScrollBar &rScroll, tools::Long nRangeMax, tools::Long nVisible, tools::Long nPos, bool bLayoutRTL)