37#include <rtl/math.hxx>
44#include <document.hxx>
54#include <unonames.hxx>
57#include <inputwin.hxx>
72#include <com/sun/star/container/XNameContainer.hpp>
73#include <com/sun/star/document/NamedPropertyValues.hpp>
77#define SC_GROWY_SMALL_EXTRA 100
78#define SC_GROWY_BIG_EXTRA 200
90 { pOtherViewShell->RemoveWindowFromForeignEditView(pTabViewShell, eWhich); };
100void collectUIInformation(std::map<OUString, OUString>&& aParameters,
const OUString& rAction)
103 aDescription.
aID =
"grid_window";
104 aDescription.
aAction = rAction;
106 aDescription.
aParent =
"MainWindow";
107 aDescription.
aKeyWord =
"ScGridWinUIObject";
117 if (rValue1.first ==
null || rValue2.first ==
null)
119 return rValue1.second < rValue2.second;
123 return rValue1.first < rValue2.first;
130 mData.insert(std::make_pair(-1, 0));
141 SAL_INFO(
"sc.lok.poshelper",
"ScPositionHelper::insert: nIndex: "
145 mData.insert(aValue);
147 "ScPositionHelper::insert: after insert: size: " <<
mData.size());
154 SAL_INFO(
"sc.lok.poshelper",
"ScPositionHelper::remove: nIndex: " <<
nIndex
155 <<
", size: " <<
mData.size());
157 if (it ==
mData.end())
return;
160 "ScPositionHelper::remove: after erase: size: " <<
mData.size());
165 SAL_INFO(
"sc.lok.poshelper",
"ScPositionHelper::invalidate: nIndex: " <<
nIndex);
169 mData.insert(std::make_pair(-1, 0));
173 auto it =
mData.lower_bound(std::make_pair(
nIndex, 0));
180 SAL_INFO(
"sc.lok.poshelper",
"ScPositionHelper::invalidate: nPos: " <<
nPos);
184 mData.insert(std::make_pair(-1, 0));
197 "ScPositionHelper::getNearest: nIndex: " <<
nIndex <<
", size: " <<
mData.size());
198 auto posUB =
mData.upper_bound(std::make_pair(
nIndex, 0));
199 if (posUB ==
mData.begin())
204 auto posLB = std::prev(posUB);
206 if (posUB ==
mData.end())
213 if (nDiffUB < -nDiffLB)
227 "ScPositionHelper::getNearest: nPos: " <<
nPos <<
", size: " <<
mData.size());
230 if (posUB ==
mData.begin())
235 auto posLB = std::prev(posUB);
237 if (posUB ==
mData.end())
245 if (nDiffUB < -nDiffLB)
258 if (it ==
mData.end())
return -1;
276 nTotalPixels += getSizePx(nIdx);
283 nTotalPixels -= getSizePx(nIdx);
290 : rDoc(rView.GetDocument())
292 , bColumnHeader(bColHeader)
294 , mfPPTX(rView.GetPPTX())
295 , mfPPTY(rView.GetPPTY())
298 , nFirstPositionPx(-1)
299 , nSecondPositionPx(-1)
342 nFoundIndex, nPosition, bTowards);
345 nFoundIndex, nPosition, bTowards);
352 SAL_INFO(
"sc.lok.header",
"BoundsProvider: nFirstBound: " << nFirstBound
353 <<
", nSecondBound: " << nSecondBound);
355 tools::Long nFirstDiff = aFirstNearest.second - nFirstBound;
356 tools::Long nSecondDiff = aSecondNearest.second - nSecondBound;
357 SAL_INFO(
"sc.lok.header",
"BoundsProvider: rTopNearest: index: " << aFirstNearest.first
358 <<
", pos: " << aFirstNearest.second <<
", diff: " << nFirstDiff);
359 SAL_INFO(
"sc.lok.header",
"BoundsProvider: rBottomNearest: index: " << aSecondNearest.first
360 <<
", pos: " << aSecondNearest.second <<
", diff: " << nSecondDiff);
362 bool bReverse = (std::abs(nFirstDiff) >= std::abs(nSecondDiff));
366 std::swap(aFirstNearest, aSecondNearest);
367 std::swap(nFirstBound, nSecondBound);
368 std::swap(nFirstDiff, nSecondDiff);
371 index_type nNearestIndex = aFirstNearest.first;
372 tools::Long nNearestPosition = aFirstNearest.second;
373 SAL_INFO(
"sc.lok.header",
"BoundsProvider: nearest to first bound: nNearestIndex: "
374 << nNearestIndex <<
", nNearestPosition: " << nNearestPosition);
383 nNearestIndex = aSecondNearest.first;
384 nNearestPosition = aSecondNearest.second;
390 nSecondDiff = !bReverse ? -1 : 1;
392 SAL_INFO(
"sc.lok.header",
"BoundsProvider: nearest to second bound: nNearestIndex: "
393 << nNearestIndex <<
", nNearestPosition: " << nNearestPosition
394 <<
", diff: " << nSecondDiff);
443 if (nBound >= nNearestPosition)
446 nPosition = nNearestPosition;
451 nNearestPosition -= nSizePx;
453 if (!bTowards && nFoundIndex != -1)
456 nPosition +=
GetSize(nFoundIndex);
468 nNearestPosition += nSizePx;
470 if (nNearestPosition > nBound)
473 nPosition = nNearestPosition;
477 if (nFoundIndex == -2)
480 nPosition = nNearestPosition;
484 nPosition -=
GetSize(nFoundIndex);
506 aWidthHelper(pDoc, true),
507 aHeightHelper(pDoc, false),
511 mbOldCursorValid( false )
532 beans::PropertyValue* pSettings = rSettings.getArray();
544 nExFixPosX, nExFixPosY,
545 nExHSplitPos, nExVSplitPos, nTab);
554 if(nExFixPosX != 0 || nExFixPosY != 0 || nExHSplitPos != 0 || nExVSplitPos != 0)
610 sal_Int32 nTemp32(0);
611 sal_Int16 nTemp16(0);
612 sal_Int32 nTempPosV(0);
613 sal_Int32 nTempPosH(0);
614 sal_Int32 nTempPosVTw(0);
615 sal_Int32 nTempPosHTw(0);
616 bool bHasVSplitInTwips =
false;
617 bool bHasHSplitInTwips =
false;
618 for (
const auto& rSetting : aSettings)
620 OUString
sName(rSetting.Name);
623 rSetting.Value >>= nTemp32;
628 rSetting.Value >>= nTemp32;
643 rSetting.Value >>= nTempPosH;
644 bHasHSplitInTwips =
false;
648 rSetting.Value >>= nTempPosV;
649 bHasVSplitInTwips =
false;
653 rSetting.Value >>= nTempPosHTw;
654 bHasHSplitInTwips =
true;
658 rSetting.Value >>= nTempPosVTw;
659 bHasVSplitInTwips =
true;
668 rSetting.Value >>= nTemp32;
673 rSetting.Value >>= nTemp32;
678 rSetting.Value >>= nTemp32;
683 rSetting.Value >>= nTemp32;
688 rSetting.Value >>= nTemp16;
694 rSetting.Value >>= nTemp32;
701 rSetting.Value >>= nTemp32;
712 bool bSelected =
false;
713 rSetting.Value >>= bSelected;
720 rSetting.Value >>= aColor;
783 maMarkData (pDocSh ? pDocSh->GetDocument().GetSheetLimits() : pDoc->GetSheetLimits()),
784 pDocShell ( pDocSh ),
785 mrDoc (pDocSh ? pDocSh->GetDocument() : *pDoc),
787 maOptions (pDocSh ? pDocSh->GetDocument().GetViewOptions() :
DefaultOptions()),
788 pSpellingView ( nullptr ),
793 aDefPageZoomX( 3,5 ),
794 aDefPageZoomY( 3,5 ),
813 bIsRefMode ( false ),
814 bDelMarkValid( false ),
815 bPagebreak ( false ),
816 bSelCtrlMouseClick( false ),
820 m_nLOKPageUpDownOffset( 0 )
822 assert(
bool(pDoc) !=
bool(pDocSh));
853 xTabData->InitData(
mrDoc);
893 collectUIInformation({{}},
"InsertTab");
907 for (
SCTAB i = nTab;
i < nTab + nNewSheets; ++
i)
951 OSL_FAIL(
"too many sheets");
956 OSL_FAIL(
"pTabData out of bounds, FIX IT");
973 std::unique_ptr<ScViewDataTable> pTab;
995 for (
const auto& rTab : rvTabs )
1001 bool bAll = tabs.empty();
1011 i->eZoomType = eNew;
1017 for (
const SCTAB&
i : tabs )
1027 std::vector< SCTAB > vTabs;
1031 vTabs.insert(vTabs.begin(), itr, itrEnd);
1038 bool bAll = tabs.empty();
1044 "fraction rNewX not sensible: " <<
static_cast<double>(rNewX));
1046 "fraction rNewY not sensible: " <<
static_cast<double>(rNewY));
1056 i->aPageZoomX = rNewX;
1057 i->aPageZoomY = rNewY;
1079 for (
const SCTAB&
i : tabs )
1101 std::vector< SCTAB > vTabs;
1105 vTabs.insert(vTabs.begin(), itr, itrEnd);
1107 SetZoom( rNewX, rNewY, vTabs );
1163 if ( nRow < 1 || nCol < 1 )
1193 aRange.
GetVars( rStartCol, rStartRow, rStartTab, rEndCol, rEndRow, rEndTab);
1338 const sal_Int32 kMax = 23 * 1024 * 1024;
1414 return maTabData[nForTab]->nPosX[eWhich];
1428 return maTabData[nForTab]->nPosY[eWhich];
1468 auto GetColWidthPx = [
this, nTab](
SCCOL nCol) {
1476 SAL_INFO(
"sc.lok.docsize",
"ScViewData::SetMaxTiledCol: nNewMaxCol: "
1477 << nNewMaxCol <<
", nTotalPixels: " << nTotalPixels);
1493 auto GetRowHeightPx = [
this, nTab](
SCROW nRow) {
1501 SAL_INFO(
"sc.lok.docsize",
"ScViewData::SetMaxTiledRow: nNewMaxRow: "
1502 << nNewMaxRow <<
", nTotalPixels: " << nTotalPixels);
1512 bool bForceToTop,
bool bInPrintTwips )
1514 Point aCellTopLeft = bInPrintTwips ?
1530 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
1531 bool bLOKLayoutRTL = bLOKActive && bLayoutRTL;
1533 bool bWasThere =
false;
1544 pEditView[eWhich]->SetEditEngine(pNewEngine);
1547 if (
pEditView[eWhich]->GetWindow() != pWin)
1551 OSL_FAIL(
"EditView Window has changed");
1561 pEditView[eWhich]->SetBroadcastLOKViewCursor(bLOKPrintTwips);
1567 if (!bWasThere && bLOKActive)
1572 [pThisViewShell, nThisTabNo, eWhich] (
ScTabViewShell* pOtherViewShell)
1574 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
1576 if (nThisTabNo == nOtherTabNo)
1577 pOtherViewShell->AddWindowToForeignEditView(pThisViewShell, eWhich);
1589 pEditView[eWhich]->SetControlWord(nVC & ~EVControlBits::AUTOSCROLL);
1596 bool bBreak = ( eJust == SvxCellHorJustify::Block ) ||
1615 if (
GetEditAdjust() == SvxAdjust::Right || bAsianVertical )
1624 if (!
pEditView[eWhich]->HasLOKSpecialPositioning())
1625 pEditView[eWhich]->InitLOKSpecialPositioning(MapUnit::MapTwip, aPTwipsRect,
Point());
1627 pEditView[eWhich]->SetLOKSpecialOutputArea(aPTwipsRect);
1630 if (bLOKActive &&
pEditView[eWhich]->HasLOKSpecialPositioning())
1631 pEditView[eWhich]->SetLOKSpecialFlags(bLOKLayoutRTL ? LOKSpecialFlags::LayoutRTL : LOKSpecialFlags::NONE);
1634 pEditView[eWhich]->SetOutputArea( aOutputArea );
1656 bool bGrowCentered = ( eJust == SvxCellHorJustify::Center );
1657 bool bGrowToLeft = ( eJust == SvxCellHorJustify::Right );
1658 bool bLOKRTLInvert = (bLOKActive && bLayoutRTL);
1659 if ( bAsianVertical )
1660 bGrowCentered = bGrowToLeft =
false;
1666 tools::Long nGridWidthTwips = 0, nGridHeightTwips = 0;
1669 Size aGridSize(nGridWidthPx, nGridHeightPx);
1673 rWinMapMode,
MapMode(MapUnit::MapTwip));
1674 nGridWidthTwips = aGridSize.
Width();
1675 nGridHeightTwips = aGridSize.
Height();
1678 if (bBreak && !bAsianVertical)
1682 nSizeXPTwips = aPTwipsRect.
GetWidth();
1686 OSL_ENSURE(
pView,
"no View for EditView");
1688 if ( bGrowCentered )
1694 nSizeXPix = aPixRect.
GetWidth() + 2 * std::min( nLeft, nRight );
1699 nSizeXPTwips = aPTwipsRect.
GetWidth() + 2 * std::min(nLeftPTwips, nRightPTwips);
1702 else if ( (bGrowToLeft && !bLOKRTLInvert) || (!bGrowToLeft && bLOKRTLInvert) )
1704 nSizeXPix = aPixRect.
Right();
1706 nSizeXPTwips = aPTwipsRect.
Right();
1710 nSizeXPix = nGridWidthPx - aPixRect.
Left();
1712 nSizeXPTwips = nGridWidthTwips - aPTwipsRect.
Left();
1715 if ( nSizeXPix <= 0 )
1719 nSizeXPTwips = aPTwipsRect.
GetWidth();
1722 OSL_ENSURE(
pView,
"no View for EditView");
1724 tools::Long nSizeYPTwips = bLOKPrintTwips ? (nGridHeightTwips - aPTwipsRect.
Top()) : 0;
1726 if ( nSizeYPix <= 0 )
1734 Size aPaperSizePTwips(nSizeXPTwips, nSizeYPTwips);
1735 if ( bBreak && !bAsianVertical &&
SC_MOD()->GetInputOptions().GetTextWysiwyg() )
1760 aVisPTwips =
pEditView[eWhich]->GetLOKSpecialVisArea();
1775 aVisPTwips.
SetRight( ( aPaperSizePTwips.
Width() - 1 + nDiffPTwips ) / 2 );
1796 pEditView[eWhich]->SetLOKSpecialVisArea(aVisPTwips);
1807 if (aDocPos.
Y() < aOutputArea.
Top())
1808 pEditView[eWhich]->Scroll( 0, aOutputArea.
Top() - aDocPos.
Y() );
1824 pEditView[eWhich]->SetBackgroundColor( aBackCol );
1833 if (nStatus & (EditStatusFlags::HSCROLL | EditStatusFlags::TextHeightChanged | EditStatusFlags::TEXTWIDTHCHANGED | EditStatusFlags::CURSOROUT))
1838 if (nStatus & EditStatusFlags::CURSOROUT)
1841 if (pEditView[eWhich])
1842 pEditView[eWhich]->ShowCursor(
false);
1861 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
1897 bool bChanged =
false;
1903 bool bGrowCentered = ( eJust == SvxCellHorJustify::Center );
1904 bool bGrowToLeft = ( eJust == SvxCellHorJustify::Right );
1905 bool bGrowBackwards = bGrowToLeft;
1907 bGrowBackwards = !bGrowBackwards;
1908 if ( bAsianVertical )
1909 bGrowCentered = bGrowToLeft = bGrowBackwards =
false;
1911 bool bUnevenGrow =
false;
1912 if ( bGrowCentered )
1925 nLogicLeftPTwips = nColWidth;
1936 nLogicRightPTwips = nColWidth;
1939 aArea.
AdjustLeft( -((bLayoutRTL && !bLOKActive) ? nLogicRight : nLogicLeft) );
1940 aArea.
AdjustRight((bLayoutRTL && !bLOKActive) ? nLogicLeft : nLogicRight );
1951 aArea.
SetLeft( nCenter - nHalf + 1 );
1958 aAreaPTwips.
SetLeft( nCenterPTwips - nHalfPTwips + 1 );
1959 aAreaPTwips.
SetRight( nCenterPTwips + aSizePTwips.
Width() - nHalfPTwips - 1 );
1964 if ( nLogicLeft != nLogicRight )
1968 else if ( bGrowBackwards )
1978 if ( !bLayoutRTL || bLOKActive )
1982 aAreaPTwips.
AdjustLeft( -nLogicWidthPTwips );
1993 if ( !bLayoutRTL || bLOKActive )
2019 if ( bLayoutRTL && !bLOKActive )
2032 if ( bLayoutRTL && !bLOKActive )
2051 if (
bMoveArea || bGrowCentered || bGrowBackwards || bLayoutRTL )
2058 if ( bGrowCentered )
2066 aVis.
SetLeft( nCenter - nVisSize / 2 );
2073 aVisPTwips.
SetLeft( nCenterPTwips - nVisSizePTwips / 2 );
2074 aVisPTwips.
SetRight( aVisPTwips.
Left() + nVisSizePTwips - 1 );
2077 else if ( bGrowToLeft )
2131 else if ( !bAsianVertical && !bGrowToLeft && !bGrowCentered )
2148 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
2158 if ( nControl & EVControlBits::AUTOSCROLL )
2198 OUString aText = pEngine->
GetText( 0 );
2199 if ( ( aText.isEmpty() && bInitial ) || aText.startsWith(
"=") )
2203 bool bChanged =
false;
2204 bool bMaxReached =
false;
2205 while (aArea.
GetHeight() + nAllowedExtra < nTextHeight &&
nEditEndRow < nBottom && !bMaxReached)
2237 if (!(nControl & EVControlBits::AUTOSCROLL))
2238 pCurView->
SetControlWord( nControl | EVControlBits::AUTOSCROLL );
2241 aArea.
SetTop( nOldBottom );
2251 for (sal_uInt16
i=0;
i<4;
i++)
2271 for (sal_uInt16
i=0;
i<4;
i++)
2323 OSL_FAIL(
"wrong sheet number");
2342 return &(
maTabData[nTabIndex]->aWidthHelper);
2352 return &(
maTabData[nTabIndex]->aHeightHelper);
2381 bool bAllowNeg,
SCTAB nForTab )
const
2407 bool bForCurTab = (nForTab ==
nTabNo);
2410 SAL_WARN(
"sc.viewdata",
"ScViewData::GetScrPos : invalid nForTab = " << nForTab);
2429 if (bAllowNeg || nWhereX >= nPosX)
2431 SCROW nStartPosX = nPosX;
2432 if (bIsTiledRendering)
2434 OSL_ENSURE(nPosX == 0,
"Unsupported case.");
2436 nStartPosX = rNearest.first + 1;
2437 nScrPosX = rNearest.second;
2440 if (nWhereX >= nStartPosX)
2442 for (
SCCOL nX = nStartPosX; nX < nWhereX && (bAllowNeg || bIsTiledRendering || nScrPosX <=
aScrSize.
Width()); nX++)
2445 nScrPosX = 0x7FFFFFFF;
2452 nScrPosX += nSizeXPix;
2456 SCCOL lastHidden = -1;
2457 if(
mrDoc.
ColHidden(nX, nForTab,
nullptr, &lastHidden) && lastHidden > nX)
2458 nX = lastHidden - 1;
2465 for (
SCCOL nX = nStartPosX; nX > nWhereX;)
2472 nScrPosX -= nSizeXPix;
2476 SCCOL firstHidden = -1;
2477 if(
mrDoc.
ColHidden(nX, nForTab, &firstHidden,
nullptr) && firstHidden >= 0)
2489 if (bAllowNeg || nWhereY >= nPosY)
2491 SCROW nStartPosY = nPosY;
2492 if (bIsTiledRendering)
2494 OSL_ENSURE(nPosY == 0,
"Unsupported case.");
2496 nStartPosY = rNearest.first + 1;
2497 nScrPosY = rNearest.second;
2500 if (nWhereY >= nStartPosY)
2502 for (
SCROW nY = nStartPosY; nY < nWhereY && (bAllowNeg || bIsTiledRendering || nScrPosY <=
aScrSize.
Height()); nY++)
2505 nScrPosY = 0x7FFFFFFF;
2512 nScrPosY += nSizeYPix;
2528 for (
SCROW nY = nStartPosY; nY > nWhereY;)
2535 nScrPosY -= nSizeYPix;
2539 SCROW firstHidden = -1;
2540 if(
mrDoc.
RowHidden(nY, nForTab, &firstHidden,
nullptr) && firstHidden >= 0)
2553 return Point( nScrPosX, nScrPosY );
2565 return Point(nPosX, nPosY);
2578 const Point aTileTwipsCellPos(aPixCellPos.
X() /
nPPTX, aPixCellPos.
Y() /
nPPTY);
2580 return aPrintTwipsCellPos + (rTileTwipsPos - aTileTwipsCellPos);
2585 const bool bPosSizeInPixels = bPixelAligned;
2591 if (bPosSizeInPixels)
2597 if (bPosSizeInPixels)
2612 tools::Long nSizeXTw = rtl::math::round(nSizeX / fPPTX) - 1;
2613 tools::Long nSizeYTw = rtl::math::round(nSizeY / fPPTY) - 1;
2615 ss << nPosXTw <<
", " << nPosYTw <<
", " << nSizeXTw <<
", " << nSizeYTw <<
", "
2616 << nX <<
", " << nY;
2625 ss << aCellPos.
getX() <<
", " << aCellPos.
getY()
2626 <<
", " << nSizeX <<
", " << nSizeY <<
", "
2627 << nX <<
", " << nY;
2630 return OString(ss.str());
2636 OSL_ENSURE( nDir==1 || nDir==-1,
"wrong CellsAt call" );
2642 sal_uInt16 nScrPosX = 0;
2651 for ( ; nScrPosX<=nScrSizeX && !bOut; nX = sal::static_int_cast<SCCOL>(nX + nDir) )
2662 nScrPosX = sal::static_int_cast<sal_uInt16>( nScrPosX +
static_cast<sal_uInt16
>(nSizeXPix) );
2668 nX = sal::static_int_cast<SCCOL>( nX - nPosX );
2678 OSL_ENSURE( nDir==1 || nDir==-1,
"wrong CellsAt call" );
2704 nY -= (nY == 0 ? 2 : 1);
2744 for (
SCROW nRow = nY; nRow <= nY+nCountY-1; ++nRow)
2746 SCROW nLastRow = nRow;
2757 rSizeXPix = nOutWidth;
2758 rSizeYPix = nOutHeight;
2782 return (nCountX > 1 || nCountY > 1);
2787 bool bTestMerge,
bool bRepair,
SCTAB nForTab )
2793 bool bForCurTab = (nForTab ==
nTabNo);
2796 SAL_WARN(
"sc.viewdata",
"ScViewData::GetPosFromPixel : invalid nForTab = " << nForTab);
2824 while (rPosX <=
mrDoc.
MaxCol() && nClickX >= nScrX)
2833 while ( rPosX>0 && nClickX < nScrX )
2845 while ( rPosY>0 && nClickY < nScrY )
2853 if ( rPosX == nStartPosX && nClickX > 0 )
2860 if ( rPosY == nStartPosY && nClickY > 0 )
2871 if (!(bTestMerge && bForCurTab))
2875 SCCOL nOrigX = rPosX;
2876 SCROW nOrigY = rPosY;
2878 bool bHOver = (nOrigX != rPosX);
2879 bool bVOver = (nOrigY != rPosY);
2881 if ( !(bRepair && ( bHOver || bVOver )) )
2888 OSL_FAIL(
"merge error found");
2901 SCCOL nPosX,
SCROW nPosY,
bool& rLeft,
bool& rTop )
2910 rLeft = ( rClickPos.
X() - aCellStart.
X() ) * nLayoutSign <= nSizeX / 2;
2911 rTop = rClickPos.
Y() - aCellStart.
Y() <= nSizeY / 2;
2918 if (nNewPosX != 0 && !bIsTiledRendering)
2924 if ( nNewPosX > nOldPosX )
2925 for (
i=nOldPosX;
i<nNewPosX;
i++ )
2929 nPixPosX -=
ToPixel(sal::static_int_cast<sal_uInt16>(nThis),
nPPTX);
2932 for (
i=nNewPosX;
i<nOldPosX;
i++ )
2936 nPixPosX +=
ToPixel(sal::static_int_cast<sal_uInt16>(nThis),
nPPTX);
2957 if (nNewPosY != 0 && !bIsTiledRendering)
2963 if ( nNewPosY > nOldPosY )
2964 for (
i=nOldPosY;
i<nNewPosY;
i++ )
2967 SCROW nRows = std::min( nNewPosY, nHeightEndRow + 1) -
i;
2969 nTPosY -= nThis * nRows;
2970 nPixPosY -=
ToPixel(sal::static_int_cast<sal_uInt16>(nThis),
nPPTY) * nRows;
2973 for (
i=nNewPosY;
i<nOldPosY;
i++ )
2976 SCROW nRows = std::min( nOldPosY, nHeightEndRow + 1) -
i;
2978 nTPosY += nThis * nRows;
2979 nPixPosY +=
ToPixel(sal::static_int_cast<sal_uInt16>(nThis),
nPPTY) * nRows;
2998 for (sal_uInt16 eWhich=0; eWhich<2; eWhich++)
3009 SCROW nLastSameHeightRow = -1;
3010 for (
SCROW j=0; j<nPosY; j++)
3012 if(nLastSameHeightRow < j)
3014 nPixPosY -= nRowHeight;
3046 for (nCol=nCol1; nCol<=nCol2; nCol++)
3052 nScrPosX +=
static_cast<sal_uInt16
>(nSizePix);
3056 for (nRow=nRow1; nRow<=nRow2; nRow++)
3062 nScrPosY +=
static_cast<sal_uInt16
>(nSizePix);
3085 if (nSize + nAdd <= nTwips + 1 && nX1 <
mrDoc.
MaxCol())
3101 if (nSize + nAdd <= nTwips + 1 && nY1 <
mrDoc.
MaxRow())
3136 assert(
pView &&
"GetBindings() without ViewShell");
3142 assert(
pView &&
"GetDispatcher() without ViewShell");
3158 assert(
pView &&
"GetDialogParent() without ViewShell");
3164 assert(
pView &&
"GetActiveWin() without View");
3170 assert(
pView &&
"GetActiveWin() without View");
3176 assert(
pView &&
"GetScDrawView() without View");
3182 assert(
pView &&
"IsMinimized() without View");
3191 SetZoom( rNewX, rNewY,
false );
3207 double nOldPPTX =
nPPTX;
3208 double nOldPPTY =
nPPTY;
3229 double fOriginal = nTwips *
nPPTX;
3230 if ( fOriginal <
static_cast<double>(nEndCol) )
3235 double fRounded = ::rtl::math::approxFloor( fOriginal + 0.5 );
3236 if ( fRounded > 0.0 )
3238 double fScale = fRounded / fOriginal + 1
E-6;
3239 if ( fScale >= 0.9 && fScale <= 1.1 )
3250 bool bResetWidths = (
nPPTX != nOldPPTX);
3251 bool bResetHeights = (
nPPTY != nOldPPTY);
3252 for (
SCTAB nTabIdx = 0; nTabIdx < nTabCount; ++nTabIdx)
3259 pWHelper->invalidateByPosition(0L);
3263 pHHelper->invalidateByPosition(0L);
3267#define SC_OLD_TABSEP '/'
3268#define SC_NEW_TABSEP '+'
3281 rData = OUString::number( nZoom ) +
"/";
3283 rData += OUString::number( nZoom ) +
"/";
3307 rData += OUString::number(
maTabData[
i]->nCurX ) + cTabSep +
3308 OUString::number(
maTabData[
i]->nCurY ) + cTabSep +
3309 OUString::number(
maTabData[
i]->eHSplitMode ) + cTabSep +
3310 OUString::number(
maTabData[
i]->eVSplitMode ) + cTabSep;
3312 rData += OUString::number(
maTabData[
i]->nFixPosX );
3314 rData += OUString::number(
maTabData[
i]->nHSplitPos );
3317 rData += OUString::number(
maTabData[
i]->nFixPosY );
3319 rData += OUString::number(
maTabData[
i]->nVSplitPos );
3321 OUString::number(
maTabData[
i]->eWhichActive ) + cTabSep +
3322 OUString::number(
maTabData[
i]->nPosX[0] ) + cTabSep +
3323 OUString::number(
maTabData[
i]->nPosX[1] ) + cTabSep +
3324 OUString::number(
maTabData[
i]->nPosY[0] ) + cTabSep +
3339 OSL_FAIL(
"ReadUserData: This is not my data");
3343 sal_Int32 nMainIdx {0};
3346 std::u16string_view aZoomStr =
o3tl::getToken(rData, 0,
';', nMainIdx);
3357 const sal_Int32 nMainIdxRef {nMainIdx};
3358 std::u16string_view aTabOpt =
o3tl::getToken(rData, 0,
';', nMainIdx);
3360 std::u16string_view aRest;
3368 nMainIdx = nMainIdxRef;
3373 while ( nMainIdx>0 )
3445 for(
SCTAB nTab = 0; nTab < static_cast<SCTAB>(
maTabData.size()); ++nTab )
3454 SCCOL nExFixPosX = pViewTab->nFixPosX;
3455 SCROW nExFixPosY = pViewTab->nFixPosY;
3462 nExFixPosX, nExFixPosY,
3463 nExHSplitPos, nExVSplitPos, nTab);
3470 OSL_ENSURE( !bRealSplit || !bFrozen,
"ScViewData::WriteExtOptions - split and freeze in same sheet" );
3479 rSplitPos =
Point( bHSplit ? nExHSplitPos : 0, bVSplit ? nExVSplitPos : 0 );
3495 switch( pViewTab->eWhichActive )
3516 rTabSett.
maCursor.
Set( pViewTab->nCurX, pViewTab->nCurY, nTab );
3554 for(
SCTAB nTab = 0; nTab < static_cast<SCTAB>(
maTabData.size()); ++nTab )
3616 bHSplit = bHSplit && aPixel.
X() > 0;
3617 bVSplit = bVSplit && aPixel.
Y() > 0;
3698 beans::PropertyValue* pSettings = rSettings.getArray();
3704 uno::Reference<container::XNameContainer> xNameContainer =
3706 for (
SCTAB nTab=0; nTab<static_cast<SCTAB>(
maTabData.size()); nTab++)
3710 uno::Sequence <beans::PropertyValue> aTableViewSettings;
3711 maTabData[nTab]->WriteUserDataSequence(aTableViewSettings, *
this, nTab);
3716 xNameContainer->insertByName(sTabName,
uno::Any(aTableViewSettings));
3719 catch ( container::ElementExistException& )
3721 OSL_FAIL(
"seems there are two tables with the same name");
3723 catch ( uno::RuntimeException& )
3725 OSL_FAIL(
"something went wrong");
3758 OUString aColorName;
3796 std::vector<bool> aHasZoomVect(
GetDocument().GetTableCount(),
false );
3798 sal_Int32 nTemp32(0);
3799 sal_Int16 nTemp16(0);
3800 sal_Int16 nFormulaBarLineCount(0);
3801 bool bPageMode(
false);
3805 for (
const auto& rSetting : rSettings)
3808 OUString
sName(rSetting.Name);
3811 uno::Reference<container::XNameContainer> xNameContainer;
3812 if ((rSetting.Value >>= xNameContainer) && xNameContainer->hasElements())
3814 const uno::Sequence< OUString > aNames(xNameContainer->getElementNames());
3815 for (
const OUString& sTabName : aNames)
3820 uno::Any aAny = xNameContainer->getByName(sTabName);
3821 uno::Sequence<beans::PropertyValue> aTabSettings;
3822 if (aAny >>= aTabSettings)
3828 bool bHasZoom =
false;
3829 maTabData[nTab]->ReadUserDataSequence(aTabSettings, *
this, nTab, bHasZoom);
3830 aHasZoomVect[nTab] = bHasZoom;
3839 if(rSetting.Value >>= sTabName)
3848 if (rSetting.Value >>= nTemp32)
3853 double fWidth = 0.0;
3854 if (rSetting.Value >>= fWidth)
3859 if (rSetting.Value >>= nTemp16)
3864 if (rSetting.Value >>= nTemp32)
3872 if (rSetting.Value >>= nTemp32)
3880 if (rSetting.Value >>= nFormulaBarLineCount)
3906 if (rSetting.Value >>= aColor)
3920 if ( rSetting.Value >>= nTemp16 )
3926 if ( rSetting.Value >>= nTemp16 )
3932 if ( rSetting.Value >>= nTemp16 )
3962 for (
SCTAB nZoomTab=0; nZoomTab< static_cast<SCTAB>(
maTabData.size()); ++nZoomTab)
3963 if (
maTabData[nZoomTab] && ( nZoomTab >=
static_cast<SCTAB>(aHasZoomVect.size()) || !aHasZoomVect[nZoomTab] ))
3972 if (rSettings.hasElements())
3993 OSL_ENSURE(
pView,
"No View" );
4003 OSL_ENSURE(
pView,
"GetMousePosPixel() without View" );
4034 sal_uInt16 nTSize = rLocalDoc.
GetColWidth( nX, nTab );
4042 if (nNewPos !=
maTabData[nTab]->nHSplitPos)
4069 sal_uInt16 nTSize = rLocalDoc.
GetRowHeight( nY, nTab );
4077 if (nNewPos !=
maTabData[nTab]->nVSplitPos)
4094 nCntrl |= EEControlBits::MARKNONURLFIELDS;
4096 nCntrl |= EEControlBits::AUTOCORRECT;
4098 nCntrl |= EEControlBits::ONLINESPELLING;
4138 while (rScrY <= nEndPixels && nRow <= nEndRow)
4140 SCROW nHeightEndRow;
4142 if (nHeightEndRow > nEndRow)
4143 nHeightEndRow = nEndRow;
4147 nRow = nHeightEndRow + 1;
4153 SCROW nRows = nHeightEndRow - nRow + 1;
4155 sal_Int64 nAdd =
nPixel * nRows;
4156 if (nAdd + rScrY > nEndPixels)
4158 sal_Int64 nDiff = rScrY + nAdd - nEndPixels;
4162 if (nAdd + rScrY <= nEndPixels)
4182 while (rScrY <= nEndPixels && nRow >= nStartRow)
4184 SCROW nHeightStartRow;
4186 if (nHeightStartRow < nStartRow)
4187 nHeightStartRow = nStartRow;
4189 nRow = nHeightStartRow - 1;
4192 SCROW nRows = nRow - nHeightStartRow + 1;
4194 sal_Int64 nAdd =
nPixel * nRows;
4195 if (nAdd + rScrY > nEndPixels)
4197 sal_Int64 nDiff = nAdd + rScrY - nEndPixels;
4201 if (nAdd + rScrY <= nEndPixels)
4219 return nFreezeIndex >= 0 ? nFreezeIndex : 0;
4230 SAL_WARN(
"sc.viewdata",
"ScViewData::SetLOKSheetFreezeIndex : invalid nForTab = " << nForTab);
4242 return colUnfreezed || rowUnfreezed;
4248 for (
SCTAB nTab = 0; nTab <= nMaxTab; ++nTab)
4256 SAL_WARN(
"sc.viewdata",
"ScViewData::DeriveLOKFreezeIfNeeded : invalid nForTab = " << nForTab);
4264 bool bConvertToFreezeX =
false;
4265 bool bConvertToFreezeY =
false;
4269 if (nFreezeCol == -1)
4275 bConvertToFreezeX =
true;
4280 if (nFreezeRow == -1)
4286 bConvertToFreezeY =
true;
4291 if (bConvertToFreezeX || bConvertToFreezeY)
4296 bConvertToFreezeY ? pViewTable->
nVSplitPos : 0,
4300 if (bConvertToFreezeX)
4302 if (bConvertToFreezeY)
4317 bool bConvertToScrPosX =
false;
4318 bool bConvertToScrPosY =
false;
4320 if (nFreezeCol >= 0)
4327 nExFixPosX = nFreezeCol;
4331 bConvertToScrPosX =
true;
4334 if (nFreezeRow >= 0)
4341 nExFixPosY = nFreezeRow;
4345 bConvertToScrPosY =
true;
4348 if (bConvertToScrPosX || bConvertToScrPosY)
4351 if (bConvertToScrPosX)
4352 nExHSplitPos = aExSplitPos.
X();
4353 if (bConvertToScrPosY)
4354 nExVSplitPos = aExSplitPos.
Y();
css::chart::ChartAxisLabelPosition ePos
#define SC_HORIZONTAL_SPLIT_POSITION
#define SC_VERTICALSPLITPOSITION_TWIPS
#define SC_TABLE_VIEWSETTINGS
#define SC_TABLE_ZOOM_VALUE
#define SC_VERTICAL_SPLIT_MODE
#define SC_VIEWSETTINGS_COUNT
#define SC_HORIZONTAL_SPLIT_MODE
#define SC_POSITION_RIGHT
constexpr OUStringLiteral SC_ACTIVESPLITRANGE
constexpr OUStringLiteral SC_SHOWPAGEBREAKPREVIEW
constexpr OUStringLiteral SC_HORIZONTALSCROLLBARWIDTH
constexpr OUStringLiteral SC_TABLES
#define SC_VERTICAL_SPLIT_POSITION
constexpr OUStringLiteral SC_POSITIONRIGHT
#define SC_FORMULA_BAR_HEIGHT_VALUE
#define SC_RELHORIZONTALTABBARWIDTH
constexpr OUStringLiteral SC_ZOOMVALUE
constexpr OUStringLiteral SC_CURSORPOSITIONY
constexpr OUStringLiteral SC_VERTICALSPLITMODE
#define SC_TABLE_SHOWGRID
#define SC_VALUE_HIGHLIGHTING
constexpr OUStringLiteral SC_POSITIONBOTTOM
constexpr OUStringLiteral SC_VERTICALSPLITPOSITION
constexpr OUStringLiteral SC_POSITIONLEFT
constexpr OUStringLiteral SC_VIEWID
constexpr OUStringLiteral SC_ZOOMTYPE
constexpr OUStringLiteral SC_HORIZONTALSPLITPOSITION
#define SC_ACTIVE_SPLIT_RANGE
#define SC_PAGE_VIEW_ZOOM_VALUE
constexpr OUStringLiteral SC_CURSORPOSITIONX
#define SC_HORIZONTAL_SCROLL_BAR_WIDTH
#define SC_SHOWFORMULASMARKS
constexpr OUStringLiteral SC_PAGEVIEWZOOMVALUE
constexpr OUStringLiteral SC_FORMULABARHEIGHT
constexpr OUStringLiteral SC_ACTIVETABLE
#define SC_TABLE_PAGE_VIEW_ZOOM_VALUE
#define SC_HORIZONTALSPLITPOSITION_TWIPS
#define SC_TABLE_ZOOM_TYPE
#define SC_TABLE_VIEWSETTINGS_COUNT
#define SC_PAGE_BREAK_PREVIEW
constexpr OUStringLiteral SC_POSITIONTOP
constexpr OUStringLiteral SC_HORIZONTALSPLITMODE
#define SC_POSITION_BOTTOM
bool ValidTab(SCTAB nTab)
const SCCOL SC_TABSTART_NONE
const SCTAB SC_TAB_APPEND
static OutputDevice * GetDefaultDevice()
bool IsTransparent() const
OUString GetText(LineEnd eEnd=LINEEND_LF) const
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
EEControlBits GetControlWord() const
sal_Int32 GetParagraphCount() const
const Size & GetPaperSize() const
EditView * RemoveView(EditView *pEditView)
sal_uInt32 GetTextHeight() const
bool IsEffectivelyVertical() const
sal_uInt32 CalcTextWidth()
void SetControlWord(EEControlBits nWord)
void SetStatusEventHdl(const Link< EditStatus &, void > &rLink)
void SetPaperSize(const Size &rSize)
void SetLOKSpecialPaperSize(const Size &rSize)
void InsertView(EditView *pEditView, size_t nIndex=EE_APPEND)
const Size & GetLOKSpecialPaperSize() const
void SetLOKSpecialVisArea(const tools::Rectangle &rVisArea)
void SetControlWord(EVControlBits nWord)
void InvalidateOtherViewWindows(const tools::Rectangle &rInvRect)
void SetOutputArea(const tools::Rectangle &rRect)
tools::Rectangle GetVisArea() const
tools::Rectangle GetLOKSpecialVisArea() const
vcl::Window * GetWindow() const
EditEngine * GetEditEngine() const
const tools::Rectangle & GetOutputArea() const
void SetLOKSpecialOutputArea(const tools::Rectangle &rOutputArea)
const tools::Rectangle & GetLOKSpecialOutputArea() const
void SetVisArea(const tools::Rectangle &rRect)
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
void SetScaleX(const Fraction &rScaleX)
EEControlBits GetControlWord() const
void SetSpeller(css::uno::Reference< css::linguistic2::XSpellChecker1 > const &xSpeller)
void SetControlWord(EEControlBits nWord)
void SetCalcFieldValueHdl(const Link< EditFieldInfo *, void > &rLink)
void SetDefaultHorizontalTextDirection(EEHorizontalTextDirection eHTextDir)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
void GetIndexAndPos(index_type nNearestIndex, tools::Long nNearestPosition, tools::Long nBound, index_type &nFoundIndex, tools::Long &nPosition, bool bTowards, tools::Long nDiff)
void GetIndexTowards(index_type nNearestIndex, tools::Long nNearestPosition, tools::Long nBound, index_type &nFoundIndex, tools::Long &nPosition, bool bTowards)
ScBoundsProvider(const ScViewData &rView, SCTAB nT, bool bColumnHeader)
ScPositionHelper::value_type value_type
tools::Long nSecondPositionPx
void EnlargeStartBy(tools::Long nOffset)
void GetEndIndexAndPosition(SCCOL &nIndex, tools::Long &nPosition) const
const index_type MAX_INDEX
tools::Long nFirstPositionPx
tools::Long GetSize(index_type nIndex) const
void GeIndexBackwards(index_type nNearestIndex, tools::Long nNearestPosition, tools::Long nBound, index_type &nFoundIndex, tools::Long &nPosition, bool bTowards)
void Compute(value_type aFirstNearest, value_type aSecondNearest, tools::Long nFirstBound, tools::Long nSecondBound)
void EnlargeEndBy(tools::Long nOffset)
void GetStartIndexAndPosition(SCCOL &nIndex, tools::Long &nPosition) const
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
double GetOutputFactor() const
SCROW SanitizeRow(SCROW nRow) const
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
bool SetLOKFreezeCol(SCCOL nFreezeCol, SCTAB nTab)
ScClipParam & GetClipParam()
EEHorizontalTextDirection GetEditTextDirection(SCTAB nTab) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SCROW MaxRow() const
sal_uInt16 GetSheetOptimalMinRowHeight(SCTAB nTab) const
bool HasDetectiveObjects(SCTAB nTab) const
bool SetLOKFreezeRow(SCROW nFreezeRow, SCTAB nTab)
SCCOL GetLOKFreezeCol(SCTAB nTab) const
sal_uInt16 GetCommonWidth(SCCOL nEndCol, SCTAB nTab) const
SC_DLLPUBLIC void SetViewOptions(const ScViewOptions &rOpt)
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
SC_DLLPUBLIC CRFlags GetRowFlags(SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC bool GetTableArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bCalcHiddens=false) const
SCROW GetLOKFreezeRow(SCTAB nTab) const
SCCOL SanitizeCol(SCCOL nCol) 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 IsVisible(SCTAB nTab) const
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC void SetTabBgColor(SCTAB nTab, const Color &rColor)
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
SC_DLLPUBLIC SCTAB GetTableCount() const
void SetDefaultItem(const SfxPoolItem &rItem)
Set the item in the default ItemSet which is created if it doesn't exist yet.
tools::Rectangle GetEditArea(const ScPatternAttr *pPattern, bool bForceToTop)
Extended options held by an ScDocument containing additional settings for filters.
const ScExtDocSettings & GetDocSettings() const
ScExtTabSettings & GetOrCreateTabSettings(SCTAB nTab)
const ScExtTabSettings * GetTabSettings(SCTAB nTab) const
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const_iterator end() const
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
void InsertTab(SCTAB nTab)
const_iterator begin() const
std::set< SCTAB >::const_iterator const_iterator
void DeleteTab(SCTAB nTab)
SCCOL GetColMerge() const
SCROW GetRowMerge() const
svtools::ColorConfig & GetColorConfig()
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
bool operator()(const value_type &rValue1, const value_type &rValue2) const
void removeByIndex(index_type nIndex)
const value_type & getNearestByPosition(tools::Long nPos) const
tools::Long computePosition(index_type nIndex, const std::function< long(index_type)> &getSizePx)
std::set< value_type, Comp > mData
const value_type & getNearestByIndex(index_type nIndex) const
tools::Long getPosition(index_type nIndex) const
std::pair< index_type, tools::Long > value_type
ScPositionHelper(const ScDocument *pDoc, bool bColumn)
void invalidateByPosition(tools::Long nPos)
static const index_type null
void setDocument(const ScDocument &rDoc, bool bColumn)
void invalidateByIndex(index_type nIndex)
void insert(index_type nIndex, tools::Long nPos)
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
static css::uno::Reference< css::datatransfer::XTransferable2 > GetClipData(vcl::Window *pWin)
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
weld::Window * GetDialogParent()
parent window for dialogs Problem: OLE Server!
static SC_DLLPUBLIC double GetRelTabBarWidth()
Returns the current tab bar width relative to the frame window width (0.0 ... 1.0).
void ViewOptionsHasChanged(bool bHScrollChanged, bool bGraphicsChanged)
Point GetGridOffset() const
tools::Long GetGridWidth(ScHSplitPos eWhich)
tools::Long GetGridHeight(ScVSplitPos eWhich)
void SetTabBarWidth(tools::Long nNewWidth)
Sets an absolute tab bar width (in pixels).
ScGridWindow * GetActiveWin()
ScDrawView * GetScDrawView()
tools::Long GetTabBarWidth() const
Returns the current tab bar width in pixels.
double GetPendingRelTabBarWidth() const
Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0).
void SetPendingRelTabBarWidth(double fRelTabBarWidth)
Sets a relative tab bar width.
ScDocument * GetDocument() const
static SC_DLLPUBLIC ScTransferObj * GetOwnClipboard(const css::uno::Reference< css::datatransfer::XTransferable2 > &)
static sal_Int32 GetInt32FromAny(const css::uno::Any &aAny)
static bool GetBoolFromAny(const css::uno::Any &aAny)
void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &rSettings, ScViewData &rViewData, SCTAB nTab, bool &rHasZoom)
SCROW nPosY[2]
Y position of the top left cell of the visible area.
ScPositionHelper aWidthHelper
SCCOL nPosX[2]
X position of the top left cell of the visible area.
ScSplitPos SanitizeWhichActive() const
Sanitize the active split range value to not point into a grid window that would never be initialized...
void InitData(const ScDocument &rDoc)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rSettings, const ScViewData &rViewData, SCTAB nTab) const
ScViewDataTable(const ScDocument *pDoc=nullptr)
ScPositionHelper aHeightHelper
void GetMultiArea(ScRangeListRef &rRange) const
SfxDispatcher & GetDispatcher()
void SetFillMode(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
Point GetPrintTwipsPos(SCCOL nCol, SCROW nRow) const
returns the position (top-left corner) of the requested cell in print twips coordinates.
void SetScreen(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
void OverrideWithLOKFreeze(ScSplitMode &eExHSplitMode, ScSplitMode &eExVSplitMode, SCCOL &nExFixPosX, SCROW &nExFixPosY, tools::Long &nExHSplitPos, tools::Long &nExVSplitPos, SCTAB nForTab) const
void SetPagebreakMode(bool bSet)
ScViewData(ScDocument *pDoc, ScDocShell *pDocSh, ScTabViewShell *pViewSh)
void DeleteTabs(SCTAB nTab, SCTAB nSheets)
bool SetLOKSheetFreezeIndex(const SCCOLROW nFreezeIndex, bool bIsCol, SCTAB nForTab=-1)
SCCOL CellsAtX(SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY=SC_SIZE_NONE) const
void SetOptions(const ScViewOptions &rOpt)
static void AddPixelsWhile(tools::Long &rScrY, tools::Long nEndPixels, SCROW &rPosY, SCROW nEndRow, double nPPTY, const ScDocument *pDoc, SCTAB nTabNo)
while (rScrY <= nEndPixels && rPosY <= nEndRow) add pixels of row heights converted with nPPTY to rSc...
void DeriveLOKFreezeAllSheets()
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
bool UpdateFixX(SCTAB nTab=MAXTAB+1)
SAL_DLLPRIVATE void EnsureTabDataSize(size_t nSize)
void DeleteTab(SCTAB nTab)
void SetFormulaBarLines(sal_Int16 nLines)
std::unique_ptr< EditView > pEditView[4]
void EditGrowX()
Extend the output area for the edit engine view in a horizontal direction as needed.
SAL_DLLPRIVATE void UpdateCurrentTab()
void SetZoomType(SvxZoomType eNew, bool bAll)
ScDocFunc & GetDocFunc() const
ScMarkData & GetMarkData()
SCROW GetCurYForTab(SCTAB nTabIndex) const
void GetMouseQuadrant(const Point &rClickPos, ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, bool &rLeft, bool &rTop)
SCCOL GetCurXForTab(SCTAB nTabIndex) const
const Fraction & GetZoomY() const
void SetTabNo(SCTAB nNewTab)
void SetCurYForTab(SCCOL nNewCurY, SCTAB nTabIndex)
ScSplitPos eEditActivePart
bool SelectionForbidsPaste(ScDocument *pClipDoc=nullptr)
Disallow Paste on Ctrl+A all selected or another high amount of selected cells that is not the same s...
void InsertTab(SCTAB nTab)
ScDocument & GetDocument() const
ScPositionHelper & GetLOKHeightHelper()
SAL_DLLPRIVATE void CalcPPT()
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
SCCOLROW GetLOKSheetFreezeIndex(bool bIsCol) const
void SetScreenPos(const Point &rVisAreaStart)
void SetPosY(ScVSplitPos eWhich, SCROW nNewPosY)
void EditGrowY(bool bInitial=false)
Extend the output area for the edit engine view in a vertical direction as needed.
SAL_DLLPRIVATE void CreateSelectedTabData()
void UpdateInputHandler(bool bForce=false)
void SetCurXForTab(SCCOL nNewCurX, SCTAB nTabIndex)
ScGridWindow * GetActiveWin()
bool UpdateFixY(SCTAB nTab=MAXTAB+1)
OString describeCellCursorAt(SCCOL nCol, SCROW nRow, bool bPixelAligned=true) const
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rSettings) const
static bool SelectionFillDOOM(const ScRange &rRange)
Determine DOOM condition, i.e. from selected range.
void GetPosFromPixel(tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich, SCCOL &rPosX, SCROW &rPosY, bool bTestMerge=true, bool bRepair=false, SCTAB nForTab=-1)
void SetRefEnd(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
ScTabViewShell * GetViewShell() const
void SetShowGrid(bool bShow)
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
static tools::Long ToPixel(sal_uInt16 nTwips, double nFactor)
void InsertTabs(SCTAB nTab, SCTAB nNewSheets)
ScDBFunc * GetView() const
~ScViewData() COVERITY_NOEXCEPT_FALSE
void UpdateOutlinerFlags(Outliner &rOutl) const
void UpdateScreenZoom(const Fraction &rNewX, const Fraction &rNewY)
void GetFillData(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow)
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
const MapMode & GetLogicMode()
ScSplitPos GetActivePart() const
void SetMaxTiledCol(SCCOL nCol)
void GetEditView(ScSplitPos eWhich, EditView *&rViewPtr, SCCOL &rCol, SCROW &rRow)
weld::Window * GetDialogParent()
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
ScViewDataTable * pThisTab
void SetActivePart(ScSplitPos eNewActive)
::std::vector< std::unique_ptr< ScViewDataTable > > maTabData
ScPositionHelper & GetLOKWidthHelper()
void SetDragMode(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScFillMode nMode)
SCROW CellsAtY(SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX=SC_SIZE_NONE) const
void ReadUserData(std::u16string_view rData)
void CopyTab(SCTAB nSrcTab, SCTAB nDestTab)
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, std::vector< SCTAB > &tabs)
static void AddPixelsWhileBackward(tools::Long &rScrY, tools::Long nEndPixels, SCROW &rPosY, SCROW nStartRow, double nPPTY, const ScDocument *pDoc, SCTAB nTabNo)
while (rScrY <= nEndPixels && rPosY >= nStartRow) add pixels of row heights converted with nPPTY to r...
bool IsMultiMarked() const
void WriteUserData(OUString &rData)
SCCOL PrevCellsX(ScHSplitPos eWhichX) const
void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &rSettings)
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
void SetMaxTiledRow(SCROW nRow)
void SetOldCursor(SCCOL nNewX, SCROW nNewY)
const Fraction & GetZoomX() const
void DeriveLOKFreezeIfNeeded(SCTAB nForTab)
tools::Rectangle GetEditArea(ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, vcl::Window *pWin, const ScPatternAttr *pPattern, bool bForceToTop, bool bInPrintTwips=false)
SCROW PrevCellsY(ScVSplitPos eWhichY) const
Point GetPrintTwipsPosFromTileTwips(const Point &rTileTwipsPos) const
ScAddress GetCurPos() const
SvxAdjust GetEditAdjust() const
void SetPosX(ScHSplitPos eWhich, SCCOL nNewPosX)
void SetEditEngine(ScSplitPos eWhich, ScEditEngineDefaulter *pNewEngine, vcl::Window *pWin, SCCOL nNewX, SCROW nNewY)
bool GetMergeSizePrintTwips(SCCOL nX, SCROW nY, tools::Long &rSizeXTwips, tools::Long &rSizeYTwips) const
SfxBindings & GetBindings()
void MoveTab(SCTAB nSrcTab, SCTAB nDestTab)
void WriteExtOptions(ScExtDocOptions &rOpt) const
void SetCurX(SCCOL nNewCurX)
ScDrawView * GetScDrawView()
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
SAL_DLLPRIVATE void CreateTabData(SCTAB nNewTab)
bool SelectionForbidsCellFill()
Disallow cell fill (Fill,Enter,...) on Ctrl+A all selected or another high amount of selected cells.
void ReadExtOptions(const ScExtDocOptions &rOpt)
void SetCurY(SCROW nNewCurY)
void SetRefStart(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
sal_Int16 GetFormulaBarLines() const
void SetGridColor(const Color &rCol, const OUString &rName)
void SetOption(ScViewOption eOpt, bool bNew)
void SetObjMode(ScVObjType eObj, ScVObjMode eMode)
const ScGridOptions & GetGridOptions() const
bool GetOption(ScViewOption eOpt) const
Color const & GetGridColor(OUString *pStrName=nullptr) const
ScVObjMode GetObjMode(ScVObjType eObj) const
void SetGridOptions(const ScGridOptions &rNew)
static bool HasFiltered(const ScRange &rRange, const ScDocument &rDoc)
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
SfxBindings & GetBindings()
SfxInterfaceId GetCurViewId() const
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool GetGridVisible() const
bool GetUseGridSnap() const
void SetFieldDrawX(sal_uInt32 nSet)
void SetUseGridSnap(bool bSet)
void SetFieldDrawY(sal_uInt32 nSet)
sal_uInt32 GetFieldDivisionY() const
bool GetSynchronize() const
void SetSynchronize(bool bSet)
sal_uInt32 GetFieldDrawY() const
void SetGridVisible(bool bSet)
void SetFieldDivisionY(sal_uInt32 nSet)
void SetFieldDivisionX(sal_uInt32 nSet)
sal_uInt32 GetFieldDrawX() const
sal_uInt32 GetFieldDivisionX() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr sal_Int32 STD_COL_WIDTH
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
bool isCompatFlagSet(Compat flag)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
Reference< XComponentContext > getProcessComponentContext()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
sal_uInt32 toUInt32(std::u16string_view str, sal_Int16 radix=10)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
constexpr auto HMM_PER_TWIPS
@ SCEXT_PANE_BOTTOMLEFT
Bottom, or bottom-left pane.
@ SCEXT_PANE_BOTTOMRIGHT
Bottom-right pane.
@ SCEXT_PANE_TOPLEFT
Single, top, left, or top-left pane.
@ SCEXT_PANE_TOPRIGHT
Right, or top-right pane.
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
std::map< OUString, OUString > aParameters
ScRange getWholeRange() const
Return a single range that encompasses all individual ranges.
Extended settings for the document, used in import/export filters.
double mfTabBarWidth
Width of the tabbar, relative to frame window width (0.0 ... 1.0).
SCTAB mnDisplTab
Index of displayed sheet.
Extended settings for a sheet, used in import/export filters.
Point maSplitPos
Position of split.
bool mbFrozenPanes
true = Frozen panes; false = Normal splits.
ScAddress maSecondVis
Top-left visible cell in add. panes (column/row only).
ScAddress maCursor
The cursor position (column/row only).
bool mbShowGrid
Whether or not to display gridlines.
ScExtPanePos meActivePane
Active (focused) pane.
ScRangeList maSelection
Selected cell ranges (columns/rows only).
ScAddress maFirstVis
Top-left visible cell (column/row only).
tools::Long mnPageZoom
Zoom in percent for pagebreak preview.
bool mbSelected
true = Sheet is selected.
bool mbPageMode
true = Pagebreak mode; false = Normal view mode.
ScAddress maFreezePos
Position of frozen panes (column/row only).
tools::Long mnNormalZoom
Zoom in percent for normal view.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
constexpr OUStringLiteral SC_UNO_SHOWGRID
constexpr OUStringLiteral SC_UNO_OUTLSYMB
constexpr OUStringLiteral SC_UNO_RASTERVIS
constexpr OUStringLiteral SC_UNO_SHOWFORMULASMARKS
constexpr OUStringLiteral SC_UNO_SHOWNOTES
constexpr OUStringLiteral SC_UNO_SHOWOBJ
constexpr OUStringLiteral SC_UNO_SHOWDRAW
constexpr OUStringLiteral SC_UNO_SHOWPAGEBR
constexpr OUStringLiteral SC_UNO_SHEETTABS
constexpr OUStringLiteral SC_UNO_RASTERSUBX
constexpr OUStringLiteral SC_UNO_COLROWHDR
constexpr OUStringLiteral SC_UNONAME_TABCOLOR
constexpr OUStringLiteral SC_UNO_RASTERSUBY
constexpr OUStringLiteral SC_UNO_RASTERSYNC
constexpr OUStringLiteral SC_UNO_RASTERRESX
constexpr OUStringLiteral SC_UNO_SHOWCHARTS
constexpr OUStringLiteral SC_UNO_GRIDCOLOR
constexpr OUStringLiteral SC_UNO_SHOWZERO
constexpr OUStringLiteral SC_UNO_RASTERRESY
constexpr OUStringLiteral SC_UNO_SNAPTORASTER
constexpr OUStringLiteral SC_UNO_VALUEHIGH
constexpr OUStringLiteral PERCENT(u"Percent")
#define SC_GROWY_SMALL_EXTRA
#define SC_GROWY_BIG_EXTRA
IMPL_LINK(ScViewData, EditEngineHdl, EditStatus &, rStatus, void)
constexpr OUStringLiteral TAG_TABBARWIDTH
static ScViewOptions DefaultOptions()
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
ScVSplitPos WhichV(ScSplitPos ePos)