34#include <osl/diagnose.h>
42#include <overlayobject.hxx>
50#include <inputwin.hxx>
66#include <LibreOfficeKit/LibreOfficeKitEnums.h>
71#include <com/sun/star/chart2/data/HighlightedRange.hpp>
76ScRange lcl_getSubRangeByIndex(
const ScRange& rRange, sal_Int32 nIndex )
83 if( (nWidth > 0) && (nHeight > 0) && (nDepth > 0) )
86 sal_Int32 nArea = nWidth * nHeight;
87 aResult.IncCol(
static_cast< SCCOL >( nIndex % nWidth ) );
88 aResult.IncRow(
static_cast< SCROW >( (nIndex % nArea) / nWidth ) );
89 aResult.IncTab(
static_cast< SCTAB >( nIndex / nArea ) );
108 Apply<Adder>(pViewShell, eWhich);
113 Apply<Remover>(pViewShell, eWhich);
117template<ScExtraEditViewManager::ModifierTagType ModifierTag>
128 for (
int i = 0;
i < 4; ++
i)
133 Modifier<ModifierTag>(pWin);
139template<ScExtraEditViewManager::ModifierTagType ModifierTag>
143 SAL_WARN(
"sc",
"ScExtraEditViewManager::Modifier<ModifierTag>: non-specialized version should not be invoked.");
147void ScExtraEditViewManager::Modifier<ScExtraEditViewManager::Adder>(
ScGridWindow* pWin)
149 if (mpOtherEditView->AddOtherViewWindow(pWin))
154void ScExtraEditViewManager::Modifier<ScExtraEditViewManager::Remover>(
ScGridWindow* pWin)
156 if (mpOtherEditView->RemoveOtherViewWindow(pWin))
168 bool bRefMode =
SC_MOD()->IsFormulaMode();
194 for (sal_uInt16
i = 0;
i < 4;
i++)
197 pGridWin[
i]->UpdateAutoFillMark( bMarked, aMarkRange );
200 for (sal_uInt16
i = 0;
i < 2;
i++)
224 if (pWin && pWin->IsVisible())
238 if (pWin && pWin->IsVisible())
241 pWin->CursorChanged();
261 rBindings.
Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
265 rBindings.
Invalidate( SID_ATTR_CHAR_POSTURE );
266 rBindings.
Invalidate( SID_ATTR_CHAR_UNDERLINE );
272 rBindings.
Invalidate( SID_ATTR_CHAR_OVERLINE );
274 rBindings.
Invalidate( SID_ATTR_CHAR_KERNING );
277 rBindings.
Invalidate( SID_ATTR_CHAR_STRIKEOUT );
278 rBindings.
Invalidate( SID_ATTR_CHAR_SHADOWED );
280 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
281 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
282 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
283 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
284 rBindings.
Invalidate( SID_NUMBER_TYPE_FORMAT);
295 rBindings.
Invalidate( SID_SCATTR_CELLPROTECTION );
301 rBindings.
Invalidate( SID_ATTR_ALIGN_INDENT );
304 rBindings.
Invalidate( SID_ATTR_BORDER_OUTER );
305 rBindings.
Invalidate( SID_ATTR_BORDER_INNER );
306 rBindings.
Invalidate( SID_ATTR_BORDER_DIAG_TLBR );
307 rBindings.
Invalidate( SID_ATTR_BORDER_DIAG_BLTR );
308 rBindings.
Invalidate( SID_NUMBER_TYPE_FORMAT );
313 rBindings.
Invalidate( SID_ATTR_ALIGN_LINEBREAK );
316 rBindings.
Invalidate( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
317 rBindings.
Invalidate( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
318 rBindings.
Invalidate( SID_ATTR_PARA_LEFT_TO_RIGHT );
319 rBindings.
Invalidate( SID_ATTR_PARA_RIGHT_TO_LEFT );
322 rBindings.
Invalidate( SID_ALIGN_ANY_HDEFAULT );
324 rBindings.
Invalidate( SID_ALIGN_ANY_HCENTER );
326 rBindings.
Invalidate( SID_ALIGN_ANY_JUSTIFIED );
327 rBindings.
Invalidate( SID_ALIGN_ANY_VDEFAULT );
329 rBindings.
Invalidate( SID_ALIGN_ANY_VCENTER );
333 rBindings.
Invalidate( SID_NUMBER_SCIENTIFIC );
345void collectUIInformation(std::map<OUString, OUString>&& aParameters)
348 aDescription.
aID =
"grid_window";
349 aDescription.
aAction =
"SELECT";
351 aDescription.
aParent =
"MainWindow";
352 aDescription.
aKeyWord =
"ScGridWinUIObject";
376 if ( !(nPosX != nOldX || nPosY != nOldY || bNew) )
396 collectUIInformation({{
"CELL", aCurrAddress}});
406 ScModelObj* pModelObj = pDocSh ? comphelper::getFromUnoTunnel<ScModelObj>( pDocSh->
GetModel() ) : nullptr;
426 tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight());
429 tools::Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight());
432 if (aNewColArea.getWidth())
438 if (aNewRowArea.getHeight())
445 std::stringstream ss;
446 ss << aNewSize.Width() <<
", " << aNewSize.Height();
447 OString sSize = ss.str().c_str();
467 if (!xDlgController || !xDlgController->getDialog()->get_visible())
496 pNew->CopyToPrimarySelection();
505 collectUIInformation({{
"RANGE", aStartAddress +
":" + aEndAddress}});
519 rBindings.
Invalidate( SID_HYPERLINK_GETLINK );
529 pTabControl->SetProtectionSymbol(
static_cast<sal_uInt16
>(nTab)+1, bProtect);
591 rBindings.
Invalidate( SID_PASTE_UNFORMATTED );
596 rBindings.
Invalidate( FID_INS_COLUMNS_BEFORE );
598 rBindings.
Invalidate( FID_INS_COLUMNS_AFTER );
607 rBindings.
Invalidate( SID_CELL_FORMAT_RESET );
612 rBindings.
Invalidate( SID_ENABLE_HYPHENATION );
621 rBindings.
Invalidate( SID_SELECT_UNPROTECTED_CELLS );
631 bool bRefMode =
SC_MOD()->IsFormulaMode();
656Point calcHintWindowPosition(
657 const Point& rCellPos,
const Size& rCellSize,
const Size& rFrameWndSize,
const Size& rHintWndSize)
668 if (nMRight - nMargin >= rHintWndSize.
Width())
674 Point aPos = rCellPos;
675 aPos.AdjustX(rCellSize.
Width() + nMargin );
676 if (aPos.Y() + rHintWndSize.
Height() > rFrameWndSize.
Height())
679 aPos.setY( rFrameWndSize.
Height() - rHintWndSize.
Height() );
685 if (nMBottom - nMargin >= rHintWndSize.
Height())
688 if (rFrameWndSize.
Width() >= rHintWndSize.
Width())
691 Point aPos = rCellPos;
692 aPos.AdjustY(rCellSize.
Height() + nMargin );
693 if (aPos.X() + rHintWndSize.
Width() > rFrameWndSize.
Width())
696 aPos.setX( rFrameWndSize.
Width() - rHintWndSize.
Width() );
702 if (nMLeft - nMargin >= rHintWndSize.
Width())
708 Point aPos = rCellPos;
709 aPos.AdjustX( -(rHintWndSize.
Width() + nMargin) );
710 if (aPos.Y() + rHintWndSize.
Height() > rFrameWndSize.
Height())
713 aPos.setY( rFrameWndSize.
Height() - rHintWndSize.
Height() );
719 if (nMTop - nMargin >= rHintWndSize.
Height())
722 if (rFrameWndSize.
Width() >= rHintWndSize.
Width())
725 Point aPos = rCellPos;
726 aPos.AdjustY( -(rHintWndSize.
Height() + nMargin) );
727 if (aPos.X() + rHintWndSize.
Width() > rFrameWndSize.
Width())
730 aPos.setX( rFrameWndSize.
Width() - rHintWndSize.
Width() );
738 if (nMRight - nMargin >= rHintWndSize.
Width())
741 Point aPos = rCellPos;
742 aPos.AdjustX(nMargin + rCellSize.
Width() );
747 if (nMBottom - nMargin >= rHintWndSize.
Height())
750 Point aPos = rCellPos;
751 aPos.AdjustY(nMargin + rCellSize.
Height() );
756 if (nMLeft - nMargin >= rHintWndSize.
Width())
759 Point aPos = rCellPos;
760 aPos.AdjustX( -(rHintWndSize.
Width() + nMargin) );
765 if (nMTop - nMargin >= rHintWndSize.
Height())
768 Point aPos = rCellPos;
769 aPos.AdjustY( -(rHintWndSize.
Height() + nMargin) );
776 Point aPos = rCellPos;
777 aPos.AdjustX(rCellSize.
Width() );
789 bool bListValButton =
false;
800 OSL_ENSURE(
pData,
"ValidationData not found");
801 OUString aTitle, aMessage;
803 if (
pData &&
pData->GetInput( aTitle, aMessage ) && !aMessage.isEmpty() )
814 aPos.X() < aWinSize.
Width() && aPos.Y() < aWinSize.
Height() )
822 mxInputHintOO->append(std::unique_ptr<sdr::overlay::OverlayObject>(pOverlay));
829 Point aHintPos = calcHintWindowPosition(
830 aPos,
Size(nCellSizeX,nCellSizeY), aWinSize, aHintWndSize);
837 if (!pWindow->IsVisible())
840 if (!xOverlayManager.is())
844 xOverlayManager->add(*pOverlay);
845 pWindow->updateLOKInputHelp(aTitle, aMessage);
854 std::unique_ptr<ScOverlayHint> pOtherOverlay(
new ScOverlayHint(aTitle, aMessage, aCommentColor,
pFrameWin->GetFont()));
855 Point aFooPos(pWindow->PixelToLogic(aOtherPos, pWindow->GetDrawMapMode()));
856 pOtherOverlay->SetPos(aFooPos, pWindow->GetDrawMapMode());
857 xOverlayManager->add(*pOtherOverlay);
868 bListValButton =
true;
874 if (pWin && pWin->IsVisible())
875 pWin->UpdateListValPos(bListValButton, aListValPos);
898 if (xDlgController && xDlgController->getDialog()->get_visible())
899 return xDlgController->getDialog();
910 if (xDlgController && xDlgController->getDialog()->get_visible())
911 return xDlgController->getDialog();
960 if ( nCurX >= 0 && nCurY >= 0 )
963 nCellSizeX = nCellSizeY = 0;
969 bool bForceNew =
false;
987 int x,
y, width, height;
993 if ( aDlgPixel.
Right() >= 0 && aDlgPixel.
Left() < aWinSize.
Width() )
995 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX ||
996 nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
1005 if ( aCursor.
Overlaps( aDlgPixel ) )
1013 bool bBottom =
false;
1016 if ( nBotSpace > 0 && nBotSpace > nTopSpace )
1024 SCROW nDiff = nWPosY - nDeltaY;
1025 if ( nCurY >= nDiff )
1027 nSpaceY = nDlgBot + ( nBotSpace - nCellSizeY ) / 2;
1032 if ( !bBottom && nTopSpace > 0 )
1034 nSpaceY = ( nTopSpace - nCellSizeY ) / 2;
1041 SCCOL nNewDeltaX = nDeltaX;
1042 SCROW nNewDeltaY = nDeltaY;
1043 bool bDoLine =
false;
1048 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1050 nNewDeltaX = nCurX -
aViewData.
CellsAtX( nCurX, -1, eAlignX,
static_cast<sal_uInt16
>(nSpaceX) );
1055 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY || bForceNew )
1057 nNewDeltaY = nCurY -
aViewData.
CellsAtY( nCurY, -1, eAlignY,
static_cast<sal_uInt16
>(nSpaceY) );
1070 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1077 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
1087 if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
1089 nNewDeltaX = nCurX - (nSizeX / 2);
1094 if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
1096 nNewDeltaY = nCurY - (nSizeY / 2);
1108 OSL_FAIL(
"Wrong cursor mode");
1115 while ( nCurX >= nNewDeltaX+nSizeX )
1117 nNewDeltaX = nCurX-nSizeX+1;
1123 while ( nCurY >= nNewDeltaY+nSizeY )
1125 nNewDeltaY = nCurY-nSizeY+1;
1131 if ( nCurX < nNewDeltaX )
1133 if ( nCurY < nNewDeltaY )
1137 if ( nNewDeltaX != nDeltaX )
1139 if (nNewDeltaX+nSizeX-1 > rDoc.
MaxCol())
1140 nNewDeltaX = rDoc.
MaxCol()-nSizeX+1;
1144 if ( nNewDeltaY != nDeltaY )
1146 if (nNewDeltaY+nSizeY-1 > rDoc.
MaxRow())
1147 nNewDeltaY = rDoc.
MaxRow()-nSizeY+1;
1151 if ( nNewDeltaX != nDeltaX )
1152 ScrollX( nNewDeltaX - nDeltaX, eAlignX );
1153 if ( nNewDeltaY != nDeltaY )
1154 ScrollY( nNewDeltaY - nDeltaY, eAlignY );
1183 bRet =
pSelEngine->SelMouseButtonDown( rMEvt );
1195 bool bShift,
bool bControl,
bool bKeepOld,
bool bKeepSel )
1205 if (nCurX < 0) nCurX = 0;
1206 if (nCurY < 0) nCurY = 0;
1246 if (bMarked && !
SC_MOD()->IsFormulaMode())
1257 pSelEngine->CursorPosChanging( bShift, bControl );
1272 bool bShift,
bool bKeepSel )
1277 bool bSkipProtected =
false, bSkipUnprotected =
false;
1285 if ( bSkipProtected && bSkipUnprotected )
1296 nCurX = nOldX + nMovX;
1297 nCurY = nOldY + nMovY;
1307 if (nMovX < 0 && nOldX == 0)
1312 if (nMovY < 0 && nOldY == 0)
1353 SCCOL nNewX = nCurX;
1354 SCROW nNewY = nCurY;
1358 if ( nMovX > 0 || nMovY > 0 )
1383 SCCOL nNewX = nCurX;
1384 SCROW nNewY = nCurY;
1426 nMoveY = bShift ? -1 : 1;
1429 nMoveX = bShift ? -1 : 1;
1432 nMoveY = bShift ? 1 : -1;
1435 nMoveX = bShift ? 1 : -1;
1442 SCCOL nNewX = nCurX;
1443 SCROW nNewY = nCurY;
1451 rDoc.
GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY,
true,
false, rMark );
1456 if ( nNewX == nCurX && nNewY == nCurY )
1463 rDoc.
GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY,
false,
true, rMark, nTabStartCol );
1473 enum { MOD_NONE, MOD_CTRL, MOD_ALT, MOD_BOTH } eModifier =
1475 (rKCode.
IsMod2() ? MOD_BOTH : MOD_CTRL) :
1476 (rKCode.
IsMod2() ? MOD_ALT : MOD_NONE);
1488 case KEY_UP: nDY = -1;
break;
1491 if( nDX != 0 || nDY != 0 )
1546 short nMove = bShift ? -1 : 1;
1554 SCCOL nNewX = nCurX;
1555 SCROW nNewY = nCurY;
1559 rDoc.
GetNextPos( nNewX,nNewY, nTab, nMove,0, bMarked,
true, rMark );
1581 nEndCol = aMarkRange.
aEnd.
Col();
1608 nEndRow = aMarkRange.
aEnd.
Row();
1629 SCCOL nStartCol = nCol;
1646 SCROW nStartRow = nRow;
1666 SCCOL nEndCol = nStartCol;
1667 SCROW nEndRow = nStartRow;
1669 rDoc.
GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, bIncludeCursor,
false );
1761 OSL_ENSURE( nDir==-1 || nDir==1,
"SelectNextTab: invalid value");
1791 SetTabNo( nTab,
false, bExtendSelection );
1806 OSL_FAIL(
"SetTabNo: invalid sheet");
1838 SCTAB nOldPos = nTab;
1841 bool bUp = (nTab>=nOldPos);
1845 if (nTab>=nTabCount)
1858 OSL_FAIL(
"no visible sheets");
1890 bool bAllSelected =
true;
1891 for (
SCTAB nSelTab = 0; nSelTab < nTabCount; ++nSelTab)
1895 if (nTab == nSelTab)
1898 bExtendSelection =
true;
1902 bAllSelected =
false;
1903 if (bExtendSelection)
1908 if (bAllSelected && !bNew)
1911 bExtendSelection =
false;
1913 if (bExtendSelection)
1932 if (pWin && pWin->IsVisible())
1933 pWin->UpdateEditViewPos();
1938 collectUIInformation({{
"TABLE", OUString::number(nTab)}});
1945 if ( !bUnoRefDialog )
1962 MapMode aMapMode( MapUnit::Map100thMM );
1983 bool bResize =
false;
2002 pWin->SetMapMode(pWin->GetDrawMapMode());
2012 rBindings.
Invalidate( SID_DELETE_PRINTAREA );
2013 rBindings.
Invalidate( FID_DEL_MANUALBREAKS );
2017 rBindings.
Invalidate( SID_STATUS_PAGESTYLE );
2059 auto lTabSwitch = [pThisViewShell, nThisTabNo] (
ScTabViewShell* pOtherViewShell)
2061 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
2063 if (nThisTabNo == nOtherTabNo)
2065 for (
int i = 0;
i < 4; ++
i)
2075 for (
int i = 0;
i < 4; ++
i)
2104 for (sal_uInt16
i = 0;
i < 4;
i++)
2155 for (sal_uInt16
i = 0;
i < 4;
i++)
2169 if (eCurrent == eActive)
2182 bool bNotifyAcc =
false;
2185 bool bExtended = nRow1 != nRow2;
2190 for (sal_uInt16
i = 0;
i < 4;
i++)
2207 for (sal_uInt16
i = 0;
i < 4;
i++)
2221 auto lInvalidateWindows =
2227 pWin->Invalidate(rInvRect);
2234 else if (bExtended || ( bAtCursor && !bNoPaint ))
2248 bool bGrabFocus =
false;
2270 for (sal_uInt16
i = 0;
i < 4;
i++)
2292 for (sal_uInt16
i = 0;
i < 4;
i++)
2295 pGridWin[
i]->UpdateFormulas(nStartCol, nStartRow, nEndCol, nEndRow);
2323 for (
size_t i = 0;
i < 4; ++
i)
2340 if (bIsTiledRendering)
2382 tools::Long nLayoutSign = (!bIsTiledRendering && bLayoutRTL) ? -1 : 1;
2389 if (bIsTiledRendering)
2398 aEnd.setX( std::numeric_limits<int>::max() / 1000 );
2402 aEnd.setX( bLayoutRTL ? 0 :
pGridWin[
i]->GetOutputSizePixel().Width() );
2405 aEnd.AdjustX( -nLayoutSign );
2410 aEnd.setY(
pGridWin[
i]->GetOutputSizePixel().Height() );
2412 aStart.AdjustX( -nLayoutSign );
2413 aStart.AdjustY( -1 );
2424 aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
2458 bool bHiddenEdge =
false;
2461 while ( nCol1 > 0 && rDoc.
ColHidden(nCol1, nTab) )
2488 if ( nCol2 - nCol1 > 1 && nRow2 - nRow1 > 1 && !bHiddenEdge )
2511 sal_uInt16
nCount =
static_cast<sal_uInt16
>(pRangeFinder->
Count());
2520 sal_uInt16
idx = nNumber;
2553 const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges )
2559 std::vector<ReferenceMark> aReferenceMarks( nSize );
2561 for (chart2::data::HighlightedRange
const & rHighlightedRange : rHilightRanges)
2569 size_t nListSize = aRangeList.
size();
2571 aReferenceMarks.resize(nSize);
2573 for (
size_t j = 0; j < nListSize; ++j )
2577 if( rHighlightedRange.Index == - 1 )
2584 aTargetRange = lcl_getSubRangeByIndex(
p, rHighlightedRange.Index );
2637 for (sal_uInt16
i = 0;
i < 4;
i++)
2648 for (sal_uInt16
i = 0;
i < 2;
i++)
2659 for (sal_uInt16
i = 0;
i < 4;
i++)
2662 pGridWin[
i]->CreateAnchorHandle(rHdl, rAddress);
2689 for (sal_uInt16
i = 0;
i < 2;
i++)
2697 if (nEndCol >= rDoc.
MaxCol())
2698 nEndX = bLayoutRTL ? 0 : ( aWinSize.
Width()-1 );
2701 if (nStartX > nEndX)
2702 std::swap(nStartX, nEndX);
2715 for (sal_uInt16
i = 0;
i < 2;
i++)
2744 for (sal_uInt16
i = 0;
i < 2;
i++)
2752 if (nEndRow >= rDoc.
MaxRow())
2753 nEndY = aWinSize.
Height() - 1;
2756 if (nStartY > nEndY)
2757 std::swap(nStartY, nEndY);
2793 if ( !(bChangedX || bChangedY) )
2801 SetZoom( aZoomX, aZoomY,
false );
2857 OSL_ENSURE(
pGridWin[eWin],
"Corrupted document, not all SplitPos in GridWin" );
2864 for (
i=0;
i<4;
i++ )
2872 OSL_ENSURE(
i<4,
"and BOOM" );
2889 if ( eOld == eWhich )
2894 bool bRefMode =
SC_MOD()->IsFormulaMode();
2904 bool bTopCap =
pColBar[eOldH] &&
pColBar[eOldH]->IsMouseCaptured();
2905 bool bLeftCap =
pRowBar[eOldV] &&
pRowBar[eOldV]->IsMouseCaptured();
2907 bool bFocus =
pGridWin[eOld]->HasFocus();
2908 bool bCapture =
pGridWin[eOld]->IsMouseCaptured();
2925 if ( bCapture ||
pGridWin[eWhich]->IsMouseCaptured() )
2934 if ( bTopCap &&
pColBar[eNewH] )
2936 pColBar[eOldH]->SetIgnoreMove(
true);
2937 pColBar[eNewH]->SetIgnoreMove(
false);
2941 pColBar[eNewH]->CaptureMouse();
2943 if ( bLeftCap &&
pRowBar[eNewV] )
2945 pRowBar[eOldV]->SetIgnoreMove(
true);
2946 pRowBar[eNewV]->SetIgnoreMove(
false);
2950 pRowBar[eNewV]->CaptureMouse();
2962 if ( !bRefMode && !bOleActive )
2980 pWin->ClickExtern();
3011 return pGridWin[eGridWhich]->GetSizePixel().Width();
3033 return pGridWin[eGridWhich]->GetSizePixel().Height();
3040 SC_MOD()->InputEnterHandler();
3059 for (sal_uInt32
i = 0;
i < 4;
i++)
3094 for (sal_uInt16
i = 0;
i < 4;
i++)
3105 if (pWin && pWin->IsVisible() && pWin->NeedsRepaint())
bool ValidTab(SCTAB nTab)
const SCCOL SC_TABSTART_NONE
void PutInOrder(T &nStart, T &nEnd)
sal_uInt32 GetValue() const
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
EditEngine * GetEditEngine() const
tools::Rectangle GetInvalidateRect() const
virtual void ViewShellChanged()=0
virtual bool IsRefInputMode() const =0
const vcl::KeyCode & GetKeyCode() const
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
OUString GetColRowString() const
Create a human-readable string representation of the cell address.
SdrOle2Obj * GetDrawObj()
ScDPObject * GetByName(std::u16string_view rName) const
void BuildAllDimensionMembers()
const ScDocument & GetDocument() const
void UpdatePendingRowHeights(SCTAB nUpdateTab, bool bBefore=false)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC bool GetMatrixFormulaRange(const ScAddress &rCellPos, ScRange &rMatrix)
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uLong nIndex) const
SC_DLLPUBLIC bool HasSparkline(ScAddress const &rPosition)
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
SC_DLLPUBLIC bool HasDataPilotAtPosition(ScAddress const &rAddress) const
SC_DLLPUBLIC void GetNextPos(SCCOL &rCol, SCROW &rRow, SCTAB nTab, SCCOL nMovX, SCROW nMovY, bool bMarked, bool bUnprotected, const ScMarkData &rMark, SCCOL nTabStartCol=SC_TABSTART_NONE) const
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
bool IsAutoCalcShellDisabled() const
SC_DLLPUBLIC void GetDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
Return the smallest area containing at least all contiguous cells having data.
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
SC_DLLPUBLIC SCTAB GetTableCount() const
bool ValidColRow(SCCOL nCol, SCROW nRow) const
void DPLaunchFieldPopupMenu(const Point &rScrPos, const Size &rScrSize, const ScAddress &rPos, ScDPObject *pDPObj)
MapMode GetDrawMapMode(bool bForce=false)
MapMode for the drawinglayer objects.
void UpdateInputContext()
void flushOverlayManager()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void SelectTable(SCTAB nTab, bool bNew)
const ScRange & GetMarkArea() const
void SelectOneTable(SCTAB nTab)
bool IsMultiMarked() const
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
bool GetTableSelect(SCTAB nTab) const
virtual Size getDocumentSize() override
sal_uInt16 GetCurRefDlgId() const
void SetSelectionTransfer(ScSelectionTransferObj *pNew)
ScSelectionTransferObj * GetSelectionTransfer() const
void SetPos(const Point &rPos, const MapMode &rMode)
Size GetSizePixel() const
ScRangeFindData & GetObject(sal_uLong nIndex)
const OUString & GetDocName() const
bool Contains(const ScRange &) const
static bool GetRangeListFromString(ScRangeList &rRangeList, const OUString &rRangeListStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
bool Contains(const ScAddress &) const
is Address& fully in Range?
static rtl::Reference< ScSelectionTransferObj > CreateFromView(ScTabView *pSource)
bool GetForceFocusOnCurCell() const
virtual const FmFormShell * GetFormShell() const override
void SetSparklineShell(bool bActive)
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
void SetPivotShell(bool bActive)
void SetForceFocusOnCurCell(bool bFlag)
void BroadcastAccessibility(const SfxHint &rHint)
bool HasAccessibilityObjects() const
const ScInputHandler * GetInputHandler() const
bool IsRefInputMode() const
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
void UpdatePageBreakData(bool bForcePaint=false)
sal_uInt16 GetLockedModifiers() const
void TabChanged(bool bSameTabButMoved=false)
Called after moving, copying, inserting or deleting a sheet.
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
std::array< VclPtr< ScColBar >, 2 > pColBar
void FakeButtonUp(ScSplitPos eWhich)
std::array< VclPtr< ScOutlineWindow >, 2 > pRowOutline
void UpdateAutoFillMark(bool bFromPaste=false)
bool MoveCursorKeyInput(const KeyEvent &rKeyEvent)
void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, SCCOL &rAreaX, SCROW &rAreaY, ScFollowMode &rMode)
std::unique_ptr< ScViewSelectionEngine > pSelEngine
void PaintTopArea(SCCOL nStartCol, SCCOL nEndCol)
void AddWindowToForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
void SelectTabPage(const sal_uInt16 nTab)
ScHeaderFunctionSet aHdrFunc
std::shared_ptr< sc::SpellCheckContext > mpSpellCheckCxt
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
void DoChartSelection(const css::uno::Sequence< css::chart2::data::HighlightedRange > &rHilightRanges)
void DoneBlockMode(bool bContinue=false)
void MarkDataArea(bool bIncludeCursor=true)
void DoneRefMode(bool bContinue=false)
void DrawEnableAnim(bool bSet)
void SelectionChanged(bool bFromPaste=false)
void MoveCursorEnd(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
VclPtr< ScTabControl > pTabControl
SC_DLLPUBLIC void RefreshZoom()
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
void MakeEditView(ScEditEngineDefaulter *pEngine, SCCOL nCol, SCROW nRow)
void FindNextUnprot(bool bShift, bool bInSelection)
void CheckSelectionTransfer()
bool SelMouseButtonDown(const MouseEvent &rMEvt)
void ClearHighlightRanges()
void ActivateView(bool bActivate, bool bFirst)
tools::Long GetGridWidth(ScHSplitPos eWhich)
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
void UpdateHeaderWidth(const ScVSplitPos *pWhich=nullptr, const SCROW *pPosY=nullptr)
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
void MoveCursorPage(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
std::unique_ptr< sdr::overlay::OverlayObjectList > mxInputHintOO
void MoveCursorRel(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
void PaintArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScUpdateMode eMode=ScUpdateMode::All)
tools::Long GetGridHeight(ScVSplitPos eWhich)
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
static void UpdateInputLine()
ScViewData & GetViewData()
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
void SkipCursorHorizontal(SCCOL &rCurX, SCROW &rCurY, SCCOL nOldX, SCCOL nMovX)
ScGridWindow * GetActiveWin()
std::vector< ScHighlightEntry > maHighlightRanges
void DoResize(const Point &rOffset, const Size &rSize, bool bInner=false)
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
void ScrollX(tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars=true)
void MoveCursorScreen(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift)
void UpdateSelectionOverlay()
void ClickCursor(SCCOL nPosX, SCROW nPosY, bool bControl)
void UpdateFormulas(SCCOL nStartCol=-1, SCROW nStartRow=-1, SCCOL nEndCol=-1, SCROW nEndRow=-1)
SC_DLLPUBLIC void CellContentChanged()
std::unique_ptr< ScDrawView > pDrawView
ScExtraEditViewManager aExtraEditViewManager
void ActivatePart(ScSplitPos eWhich)
std::array< VclPtr< ScRowBar >, 2 > pRowBar
void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
void SelectNextTab(short nDir, bool bExtendSelection)
bool HasHintWindow() const
void CreateAnchorHandles(SdrHdlList &rHdl, const ScAddress &rAddress)
std::unique_ptr< ScHeaderSelectionEngine > pHdrSelEng
void SetMarkData(const ScMarkData &rNew)
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
void KillEditView(bool bNoPaint)
void MoveCursorEnter(bool bShift)
void InitOwnBlockMode(const ScRange &rMarkRange)
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
void SkipCursorVertical(SCCOL &rCurX, SCROW &rCurY, SCROW nOldY, SCROW nMovY)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
bool UpdateVisibleRange()
void OnLibreOfficeKitTabChanged()
void MoveCursorArea(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
void SetTabProtectionSymbol(SCTAB nTab, const bool bProtect)
void PaintRangeFinder(tools::Long nNumber)
std::array< VclPtr< ScOutlineWindow >, 2 > pColOutline
void GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL &rPageX, SCROW &rPageY)
void PaintBlock(bool bReset)
divide PaintBlock into two methods: RepaintBlock and RemoveBlock or similar
void PaintRangeFinderEntry(const ScRangeFindData *pData, SCTAB nTab)
Update marks for a selected Range.
void RepeatResize(bool bUpdateFix=true)
ScViewFunctionSet aFunctionSet
void PaintLeftArea(SCROW nStartRow, SCROW nEndRow)
VclPtr< vcl::Window > pFrameWin
void UpdateInputContext()
void RemoveWindowFromForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
sheet protection state container
bool isOptionEnabled(Option eOption) const
virtual bool isProtected() const override
SCCOL GetEditEndCol() const
SCROW GetEditEndRow() const
SCCOL CellsAtX(SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY=SC_SIZE_NONE) const
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
bool UpdateFixX(SCTAB nTab=MAXTAB+1)
const ScViewOptions & GetOptions() const
ScMarkData & GetMarkData()
SCROW GetCurYForTab(SCTAB nTabIndex) const
SCCOL GetTabStartCol() const
SCCOL GetCurXForTab(SCTAB nTabIndex) const
const Fraction & GetZoomY() const
SCROW GetEditStartRow() const
SCROW GetMaxTiledRow() const
void SetTabNo(SCTAB nNewTab)
ScDocument & GetDocument() const
void GetMoveCursor(SCCOL &rCurX, SCROW &rCurY)
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
const Size & GetScrSize() const
SCCOL GetMaxTiledCol() const
ScSplitMode GetHSplitMode() const
SCCOL GetEditStartCol() const
const MapMode & GetLogicMode(ScSplitPos eWhich)
void UpdateInputHandler(bool bForce=false)
ScDocShell * GetDocShell() const
ScGridWindow * GetActiveWin()
bool UpdateFixY(SCTAB nTab=MAXTAB+1)
void GetPosFromPixel(tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich, SCCOL &rPosX, SCROW &rPosY, bool bTestMerge=true, bool bRepair=false, SCTAB nForTab=-1)
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
void SetTabStartCol(SCCOL nNew)
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
ScSplitPos GetActivePart() const
void SetMaxTiledCol(SCCOL nCol)
void GetEditView(ScSplitPos eWhich, EditView *&rViewPtr, SCCOL &rCol, SCROW &rRow)
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
void SetActivePart(ScSplitPos eNewActive)
SCROW CellsAtY(SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX=SC_SIZE_NONE) const
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
void SetMaxTiledRow(SCROW nRow)
void SetOldCursor(SCCOL nNewX, SCROW nNewY)
ScSplitMode GetVSplitMode() const
const Fraction & GetZoomX() const
SCTAB GetRefTabNo() const
void SetSelCtrlMouseClick(bool bTmp)
bool IsPagebreakMode() const
ScAddress GetCurPos() const
void SetEditEngine(ScSplitPos eWhich, ScEditEngineDefaulter *pNewEngine, vcl::Window *pWin, SCCOL nNewX, SCROW nNewY)
void SetRefTabNo(SCTAB nNewTab)
EditView * GetSpellingView() const
SfxBindings & GetBindings()
bool HasEditView(ScSplitPos eWhich) const
void Activate(bool bActivate)
void SetCurX(SCCOL nNewCurX)
bool IsAnyFillMode() const
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
void SetCurY(SCROW nNewCurY)
bool SetCursorAtCell(SCCOL nPosX, SCROW nPosY, bool bScroll)
bool GetOption(ScViewOption eOpt) const
Size GetOrigObjSize(MapMode const *pTargetMapMode=nullptr) const
virtual const tools::Rectangle & GetLogicRect() const override
void Invalidate(sal_uInt16 nId)
std::shared_ptr< SfxDialogController > & GetController()
css::uno::Reference< css::frame::XController > GetController() const
bool SetObjArea(const tools::Rectangle &)
const tools::Rectangle & GetObjArea() const
bool IsObjectInPlaceActive() const
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
static void notifyDocumentSizeChanged(SfxViewShell const *pThisView, const OString &rPayload, vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
css::uno::Reference< css::frame::XModel3 > GetModel() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool HasChildWindow(sal_uInt16)
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
void DisconnectAllClients()
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
SfxViewFrame * GetViewFrame() const
SfxInPlaceClient * GetIPClient() const
void SetWindow(vcl::Window *pViewPort)
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
sal_uInt16 GetCode() const
Point OutputToScreenPixel(const Point &rPos) const
Point LogicToPixel(const Point &rLogicPt) const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
weld::Window * GetFrameWeld() const
#define DBG_ASSERT(sCon, aError)
const sal_uInt8 SC_CLIPMARK_SIZE
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_SHIFT
constexpr sal_uInt16 KEY_END
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
std::map< OUString, OUString > aParameters
Reference< XController > xController
static bool lcl_IsRefDlgActive(SfxViewFrame *pViewFrm)
static weld::Window * lcl_GetCareWin(SfxViewFrame *pViewFrm)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
ScHSplitPos WhichH(ScSplitPos ePos)
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
@ SC_MARK_SIMPLE_FILTERED
ScFollowMode
Screen behavior related to cursor movements.
ScVSplitPos WhichV(ScSplitPos ePos)