33 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
48 #include <document.hxx>
61 #include <globstr.hrc>
89 const OUString& rTitle,
const Color& rColor,
bool bTextBelow,
130 aOuter.
AdjustTop( -(aTextSize.Height()) );
145 tools::Long nBHeight = nVer + aTextSize.Height() + 1;
146 Size aButSize( nBWidth, nBHeight );
148 aComboButton.
Draw(
Point(nButtonPos, nButtonY), aButSize );
153 bool bWasClip =
false;
155 bool bClip = ( aTextSize.Width() > aOuter.
Right() - nBWidth - aInner.
Left() );
166 nClipEndX, nButtonY + nVer/2 + aTextSize.Height())) );
169 pDev->
DrawText(
Point( nTextStart, nButtonY + nVer/2 ), rTitle );
194 if ( nX1 > 0 ) --nX1;
195 if ( nY1>=2 ) nY1 -= 2;
196 else if ( nY1 > 0 ) --nY1;
197 if ( nX2 < rDoc.
MaxCol() ) ++nX2;
198 if ( nY2 < rDoc.
MaxRow()-1 ) nY2 += 2;
199 else if ( nY2 < rDoc.
MaxRow() ) ++nY2;
200 ScRange aViewRange( nX1,nY1,nTab, nX2,nY2,nTab );
208 aMarks.FillRangeListWithMarks( xRanges.
get(), false );
213 for (
size_t j = 0,
n = xRanges->
size(); j <
n; ++j)
215 ScRange aRange = (*xRanges)[j];
229 aStartPos.AdjustX( -nLayoutSign );
230 aStartPos.AdjustY( -1 );
231 aEndPos.AdjustX( -nLayoutSign );
232 aEndPos.AdjustY( -1 );
234 bool bTextBelow = ( aRange.
aStart.
Row() == 0 );
238 for (
SCTAB nAct=nTab+1; nAct<nTabCount && rDoc.
IsScenario(nAct); nAct++)
241 OUString aDummyComment;
243 rDoc.
GetName( nAct, aCurrent );
247 if (aCurrent.isEmpty())
248 aCurrent =
ScResId( STR_EMPTYDATA );
253 aCurrent, aColor, bTextBelow,
255 rDoc, rViewData, bLayoutRTL );
261 const std::vector<ScHighlightEntry>& rHighlightRanges )
264 for (
const auto& rHighlightRange : rHighlightRanges)
266 ScRange aRange = rHighlightRange.aRef;
272 rHighlightRange.aColor, false );
314 if (aScaleX == rEntry.aScaleX && aScaleY == rEntry.aScaleY)
316 if (rCursorRect == rEntry.aRect)
320 rEntry.aRect = rCursorRect;
325 maLOKLastCursor.push_back(
LOKCursorEntry{aScaleX, aScaleY, rCursorRect});
340 if (pViewShell != pThisViewShell && pViewShell->
GetDocId() == pThisViewShell->
GetDocId())
348 if (aZoomX == aScaleX && aZoomY == aScaleY)
351 LOK_CALLBACK_INVALIDATE_VIEW_CURSOR,
"rectangle", rCursorRect.
toString());
405 aMirroredPixel.
SetLeft( nWidth - 1 - aPixRect.
Right() );
406 aMirroredPixel.
SetRight( nWidth - 1 - aPixRect.
Left() );
410 while ( nScrX <= aMirroredPixel.
Left() && nX1 < rDoc.
MaxCol() )
416 while ( nScrX <= aMirroredPixel.
Right() && nX2 < rDoc.
MaxCol() )
425 if (nScrY <= aPixRect.
Bottom() && nY2 < rDoc.MaxRow())
456 OSL_ENSURE( rDoc.
ValidCol(nX2) && rDoc.
ValidRow(nY2),
"GridWin Draw area too big" );
492 nMirrorWidth = aScrPos.X() - nEndPixel;
493 aScrPos.setX( nEndPixel + 1 );
501 SCCOL nCurEndX = nCurX;
502 SCROW nCurEndY = nCurY;
503 rDoc.
ExtendMerge( nCurX, nCurY, nCurEndX, nCurEndY, nTab );
505 ( nCurEndX+1 >= nX1 && nCurX <= nX2+1 && nCurEndY+1 >= nY1 && nCurY <= nY2+1 );
513 rDoc.
ExtendMerge( nHdlX, nHdlY, nHdlX, nHdlY, nTab );
527 rDoc.
FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
534 nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
541 bool bLogicText = bTextWysiwyg;
557 xFmtVirtDev->SetMapMode(
MapMode(MapUnit::Map100thMM));
563 DrawContent(*
this, aTabInfo, aOutputData, bLogicText);
579 class SuppressEditViewMessagesGuard
582 SuppressEditViewMessagesGuard(
EditView& rEditView) :
583 mrEditView(rEditView),
584 mbOrigSuppressFlag(rEditView.IsSuppressLOKMessages())
586 if (!mbOrigSuppressFlag)
587 mrEditView.SuppressLOKMessages(
true);
590 ~SuppressEditViewMessagesGuard()
592 if (mrEditView.IsSuppressLOKMessages() != mbOrigSuppressFlag)
593 mrEditView.SuppressLOKMessages(mbOrigSuppressFlag);
598 const bool mbOrigSuppressFlag;
610 bool bNoBackgroundAndGrid = bIsTiledRendering
612 comphelper::LibreOfficeKit::Compat::scNoGridBackground);
663 if ( nEditEndCol >= nX1 && nEditCol <= nX2 && nEditEndRow >= nY1 && nEditRow <= nY2 )
673 if (bIsTiledRendering)
694 aDrawingRectPixel.
SetLeft( 0 );
709 aDrawingRectLogic =
PixelToLogic(aDrawingRectPixel, aDrawMode);
714 bool bInPlaceVisCursor =
false;
721 bInPlaceVisCursor = pInPlaceCrsr && pInPlaceCrsr->
IsVisible();
722 if (bInPlaceVisCursor)
723 pInPlaceCrsr->Hide();
743 pTargetPaintWindow = pDrawView->
BeginDrawLayers(pContentDev, aDrawingRegion);
744 OSL_ENSURE(pTargetPaintWindow,
"BeginDrawLayers: Got no SdrPaintWindow (!)");
746 if (!bIsTiledRendering)
776 if (aDrawRect.
Right() >= aDrawRect.
Left())
791 if (aDrawRect.
Bottom() >= aDrawRect.
Top())
814 if (bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
815 aOutputData.
DrawGrid(*pContentDev, bGrid, bPage);
819 if (!bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
820 aOutputData.
DrawGrid(*pContentDev, bGrid, bPage);
853 if (bIsTiledRendering)
884 if ( bHasChange || bHasScenario || !rHigh.empty() )
903 if (bIsTiledRendering)
915 if (bIsTiledRendering)
938 if ( pRangeFinder && !pRangeFinder->
IsHidden() &&
941 sal_uInt16
nCount =
static_cast<sal_uInt16
>(pRangeFinder->
Count());
942 for (sal_uInt16
i=0;
i<nCount;
i++)
966 if (bIsTiledRendering)
971 const double twipFactor = 15 * 1.76388889;
972 aOrigin =
Point(aOrigin.getX() * twipFactor,
973 aOrigin.getY() * twipFactor);
992 if (bIsTiledRendering)
999 if (pViewShell != pThisViewShell && pViewShell->
GetDocId() == pThisViewShell->
GetDocId())
1007 bool bOtherEditMode = rOtherViewData.
HasEditView(eOtherWhich);
1012 bOtherEditMode = bOtherEditMode
1013 && ( nCol2 >= nX1 && nCol1 <= nX2 && nRow2 >= nY1 && nRow1 <= nY2 );
1014 if (bOtherEditMode && rOtherViewData.
GetRefTabNo() == nTab)
1029 aEnd.AdjustX( -(2 * nLayoutSign) );
1038 aBackground += aOrigin;
1041 static const double twipFactor = 15 * 1.76388889;
1043 aOrigin =
Point((aOrigin.getX() * twipFactor) / static_cast<double>(aDrawMode.
GetScaleX()),
1044 (aOrigin.getY() * twipFactor) / static_cast<double>(aDrawMode.
GetScaleY()));
1068 SuppressEditViewMessagesGuard aGuard(*pOtherEditView);
1091 if (bInPlaceEditing)
1106 aEnd.AdjustX( -(2 * nLayoutSign) );
1113 if (bIsTiledRendering)
1119 aBackground += aOrigin;
1125 if (bIsTiledRendering)
1130 static const double twipFactor = 15 * 1.76388889;
1132 aOrigin =
Point((aOrigin.getX() * twipFactor) / static_cast<double>(aDrawMode.
GetScaleX()),
1133 (aOrigin.getY() * twipFactor) / static_cast<double>(aDrawMode.
GetScaleY()));
1144 rDevice.
DrawText(aLogicRect.BottomLeft(),
" ");
1148 if (bIsTiledRendering)
1164 SuppressEditViewMessagesGuard aGuard(*pEditView);
1171 if (!comphelper::LibreOfficeKit::isCompatFlagSet(
1172 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs))
1182 MapMode aMM(MapUnit::MapTwip);
1190 aCursorRect.
Move(aCursPos.getX(), 0);
1208 if (bInPlaceVisCursor)
1209 pInPlaceCrsr->Show();
1229 template<
typename IndexType>
1230 void lcl_getBoundingRowColumnforTile(
ScViewData& rViewData,
1232 sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin,
1233 sal_Int32& nTopLeftTileIndex, sal_Int32& nBottomRightTileIndex)
1235 const bool bColumnHeader = std::is_same<IndexType, SCCOL>::value;
1239 IndexType nStartIndex = -1;
1240 IndexType nEndIndex = -1;
1250 aBoundsProvider.Compute(rStartNearest, rEndNearest, nTileStartPosPx, nTileEndPosPx);
1251 aBoundsProvider.GetStartIndexAndPosition(nStartIndex, nStartPosPx); ++nStartIndex;
1252 aBoundsProvider.GetEndIndexAndPosition(nEndIndex, nEndPosPx);
1254 nTopLeftTileOffset = nTileStartPosPx - nStartPosPx;
1255 nTopLeftTileOrigin = nStartPosPx;
1256 nTopLeftTileIndex = nStartIndex;
1257 nBottomRightTileIndex = nEndIndex;
1266 explicit ScLOKProxyObjectContact(
1269 const char* pDebugName) :
1270 ObjectContactOfPageView(rPageWindow, pDebugName),
1271 mrRealObjectContact(rRealOC)
1282 if (pTargetSdrObject)
1283 rTarget = pTargetSdrObject->GetViewContact().GetViewObjectContact(mrRealObjectContact).getGridOffset();
1291 FmFormView(*rData.GetDocument().GetDrawLayer(), pOut),
1292 pScDrawView(rData.GetScDrawView())
1297 SdrPageWindow& rPageWindow,
const char* pDebugName)
const override
1302 SdrPageView* pPageView(pScDrawView->GetSdrPageView());
1306 SdrPageWindow* pSdrPageWindow = pPageView->GetPageWindow(0);
1307 if (!pSdrPageWindow)
1310 return new ScLOKProxyObjectContact(pSdrPageWindow->
GetObjectContact(), rPageWindow, pDebugName);
1319 int nOutputWidth,
int nOutputHeight,
1320 int nTilePosX,
int nTilePosY,
1344 const bool bChangeZoom = (aFracX != origZoomX || aFracY != origZoomY);
1352 pDrawView->resetGridOffsetsForAllSdrPageViews();
1355 const double fTilePosXPixel =
static_cast<double>(nTilePosX) * nOutputWidth / nTileWidth;
1356 const double fTilePosYPixel =
static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight;
1357 const double fTileBottomPixel =
static_cast<double>(nTilePosY + nTileHeight) * nOutputHeight / nTileHeight;
1358 const double fTileRightPixel =
static_cast<double>(nTilePosX + nTileWidth) * nOutputWidth / nTileWidth;
1367 sal_Int32 nTopLeftTileRowOffset = 0;
1368 sal_Int32 nTopLeftTileColOffset = 0;
1369 sal_Int32 nTopLeftTileRowOrigin = 0;
1370 sal_Int32 nTopLeftTileColOrigin = 0;
1372 sal_Int32 nTopLeftTileRow = 0;
1373 sal_Int32 nTopLeftTileCol = 0;
1374 sal_Int32 nBottomRightTileRow = 0;
1375 sal_Int32 nBottomRightTileCol = 0;
1377 lcl_getBoundingRowColumnforTile<SCROW>(
mrViewData,
1378 fTilePosYPixel, fTileBottomPixel,
1379 nTopLeftTileRowOffset, nTopLeftTileRowOrigin,
1380 nTopLeftTileRow, nBottomRightTileRow);
1382 lcl_getBoundingRowColumnforTile<SCCOL>(
mrViewData,
1383 fTilePosXPixel, fTileRightPixel,
1384 nTopLeftTileColOffset, nTopLeftTileColOrigin,
1385 nTopLeftTileCol, nBottomRightTileCol);
1388 nBottomRightTileCol++;
1389 nBottomRightTileRow++;
1391 if (nBottomRightTileCol > rDoc.
MaxCol())
1392 nBottomRightTileCol = rDoc.
MaxCol();
1402 if (nEndCol < nBottomRightTileCol)
1403 nEndCol = nBottomRightTileCol;
1405 if (nEndRow < nBottomRightTileRow)
1406 nEndRow = nBottomRightTileRow;
1408 nTopLeftTileCol = std::max<sal_Int32>(nTopLeftTileCol, 0);
1409 nTopLeftTileRow = std::max<sal_Int32>(nTopLeftTileRow, 0);
1418 MapMode aAbsMode = aOriginalMode;
1419 const Point aOrigin(-nTopLeftTileColOrigin, -nTopLeftTileRowOrigin);
1424 rDoc.
FillInfo(aTabInfo, nTopLeftTileCol, nTopLeftTileRow,
1425 nBottomRightTileCol, nBottomRightTileRow,
1426 nTab, fPPTX, fPPTY,
false,
false);
1432 -nTopLeftTileColOffset,
1433 -nTopLeftTileRowOffset,
1434 nTopLeftTileCol, nTopLeftTileRow,
1435 nBottomRightTileCol, nBottomRightTileRow,
1436 fPPTX, fPPTY,
nullptr,
nullptr);
1443 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
1457 DrawContent(rDevice, aTabInfo, aOutputData,
true);
1461 rDoc.
ResetChanged(
ScRange(nTopLeftTileCol, nTopLeftTileRow, nTab, nBottomRightTileCol, nBottomRightTileRow, nTab));
1464 mrViewData.SetZoom(origZoomX, origZoomY,
true);
1467 if (
ScDrawView* pDrawView = mrViewData.GetScDrawView())
1468 pDrawView->resetGridOffsetsForAllSdrPageViews();
1476 sRectangle =
"EMPTY";
1488 sRectangle = aRectangle.
toString();
1501 if (pInputHandler && pInputHandler->
IsInputMode())
1508 if (nType == LOK_SETTEXTSELECTION_RESET)
1521 bool bWasEmpty =
false;
1522 if (aRangeList.
empty())
1529 aRangeList.
Combine().
GetVars(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
1540 case LOK_SETTEXTSELECTION_START:
1541 if (nNewPosX != nCol1 || nNewPosY != nRow1 || bWasEmpty)
1543 pTabView->
SetCursor(nNewPosX, nNewPosY);
1549 case LOK_SETTEXTSELECTION_END:
1550 if (nNewPosX != nCol2 || nNewPosY != nRow2 || bWasEmpty)
1555 pTabView->
MarkCursor(nNewPosX, nNewPosY, nTab);
1598 OUString aPageStr =
ScResId( STR_PGNUM );
1608 std::unique_ptr<ScEditEngineDefaulter> pEditEng;
1621 pEditEng->SetRefMapMode(rRenderContext.
GetMapMode());
1622 auto pEditDefaults = std::make_unique<SfxItemSet>( pEditEng->GetEmptyItemSet() );
1625 pEditEng->SetDefaults( std::move(pEditDefaults) );
1628 sal_uInt16
nCount = sal::static_int_cast<sal_uInt16>( pPageData->
GetCount() );
1649 aStart.AdjustX( -2 );
1650 aStart.AdjustY( -2 );
1653 if ( aStart.X() < -10 ) aStart.setX( -10 );
1654 if ( aStart.Y() < -10 ) aStart.setY( -10 );
1655 if ( aEnd.X() > aWinSize.
Width() + 10 )
1656 aEnd.setX( aWinSize.
Width() + 10 );
1657 if ( aEnd.Y() > aWinSize.
Height() + 10 )
1658 aEnd.setY( aWinSize.
Height() + 10 );
1671 for (nColPos=0; nColPos+1<nColBreaks; nColPos++)
1673 SCCOL nBreak = pColEnd[nColPos]+1;
1674 if ( nBreak >= nX1 && nBreak <= nX2+1 )
1690 for (nRowPos=0; nRowPos+1<nRowBreaks; nRowPos++)
1692 SCROW nBreak = pRowEnd[nRowPos]+1;
1693 if ( nBreak >= nY1 && nBreak <= nY2+1 )
1709 for (nRowPos=0; nRowPos<nRowBreaks; nRowPos++)
1711 SCROW nPrEndY = pRowEnd[nRowPos];
1712 if ( nPrEndY >= nY1 && nPrStartY <= nY2 )
1715 for (nColPos=0; nColPos<nColBreaks; nColPos++)
1717 SCCOL nPrEndX = pColEnd[nColPos];
1718 if ( nPrEndX >= nX1 && nPrStartX <= nX2 )
1721 nPrStartX, nPrStartY,
eWhich,
true );
1723 nPrEndX+1,nPrEndY+1,
eWhich,
true );
1727 nPageNo += static_cast<tools::Long>(nColPos)*nRowBreaks+nRowPos;
1729 nPageNo +=
static_cast<tools::Long>(nRowPos)*nColBreaks+nColPos;
1731 OUString aThisPageStr = aPageStr.replaceFirst(
"%1", OUString::number(nPageNo));
1740 pEditEng->SetTextCurrentDefaults( aThisPageStr );
1741 Size aSize100( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
1744 tools::Long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.
Width();
1745 tools::Long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
1746 nHeight = std::min(nSizeX,nSizeY);
1752 Size aTextSize( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
1753 Point aPos( (aPageStart.X()+aPageEnd.X()-aTextSize.Width())/2,
1754 (aPageStart.Y()+aPageEnd.Y()-aTextSize.Height())/2 );
1755 pEditEng->Draw( &rRenderContext, aPos );
1761 rRenderContext.
SetFont( aFont );
1765 tools::Long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.
Width();
1766 tools::Long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
1768 rRenderContext.
SetFont( aFont );
1772 Point aPos( (aPageStart.X()+aPageEnd.X()-aTextSize.Width())/2,
1773 (aPageStart.Y()+aPageEnd.Y()-aTextSize.Height())/2 );
1774 rRenderContext.
DrawText( aPos, aThisPageStr );
1777 nPrStartX = nPrEndX + 1;
1780 nPrStartY = nPrEndY + 1;
1799 std::unique_ptr<ScQueryParam> pQueryParam;
1809 for (nArrY=1; nArrY+1<nArrCount; nArrY++)
1811 if ( pRowInfo[nArrY].bAutoFilter && pRowInfo[nArrY].bChanged )
1813 RowInfo* pThisRowInfo = &pRowInfo[nArrY];
1815 nRow = pThisRowInfo->
nRowNo;
1817 for (nCol=nX1; nCol<=nX2; nCol++)
1827 bool bNewData =
true;
1835 pDBData->
GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
1836 if ( nCol >= nStartCol && nCol <= nEndCol &&
1837 nRow >= nStartRow && nRow <= nEndRow )
1853 bool bSimpleQuery =
true;
1854 bool bColumnFound =
false;
1855 if (!pQueryParam->bInplace)
1856 bSimpleQuery =
false;
1858 for (nQuery = 0; nQuery < nCount && bSimpleQuery; ++nQuery)
1859 if (pQueryParam->GetEntry(nQuery).bDoQuery)
1864 if (pQueryParam->GetEntry(nQuery).nField == nCol)
1865 bColumnFound =
true;
1867 if (pQueryParam->GetEntry(nQuery).eConnect !=
SC_AND)
1868 bSimpleQuery =
false;
1871 bool bArrowState = bSimpleQuery && bColumnFound;
1874 SCCOL nStartCol= nCol;
1875 SCROW nStartRow = nRow;
1883 aCellBtn.setBoundingBox(aScrPos,
Size(nSizeX-1, nSizeY-1), bLayoutRTL);
1884 aCellBtn.setPopupLeft(bLayoutRTL);
1885 aCellBtn.setDrawBaseButton(
false);
1886 aCellBtn.setDrawPopupButton(
true);
1887 aCellBtn.setHasHiddenMember(bArrowState);
1893 if ( pRowInfo[nArrY].bPivotButton && pRowInfo[nArrY].bChanged )
1895 RowInfo* pThisRowInfo = &pRowInfo[nArrY];
1896 nRow = pThisRowInfo->
nRowNo;
1897 for (nCol=nX1; nCol<=nX2; nCol++)
1912 aCellBtn.setText(aStr);
1913 aCellBtn.setBoundingBox(
Point(nPosX, nPosY),
Size(nSizeX-1, nSizeY-1), bLayoutRTL);
1914 aCellBtn.setPopupLeft(
false);
1935 pQueryParam.reset();
1961 SCCOL nNextCol = nCol + 1;
1967 bool bNextCell = ( nNextCol <= rDoc.
MaxCol() );
1971 if ( nAvailable < aBtnSize.
Width() )
1973 if ( nCellSizeY < aBtnSize.
Height() )
1977 aPos.AdjustX(nCellSizeX * nLayoutSign );
1979 aPos.AdjustX( -(aBtnSize.
Width() * nLayoutSign) );
1980 aPos.AdjustY(nCellSizeY - aBtnSize.
Height() );
1984 aPos.AdjustX( -(aBtnSize.
Width()-1) );
1999 OSL_FAIL(
"Auto filter button without DBData");
2002 bool bSimpleQuery =
true;
2003 bool bColumnFound =
false;
2007 bSimpleQuery =
false;
2012 for (nQuery = 0; nQuery < nCount && bSimpleQuery; ++nQuery)
2016 bColumnFound =
true;
2020 bSimpleQuery =
false;
2023 return ( bSimpleQuery && bColumnFound );
2038 ::std::vector< tools::Rectangle >& rPixelRects )
const
2044 ::std::vector< tools::Rectangle >& rRects,
2045 bool bInPrintTwips)
const
2067 SCCOL nTestX2 = nX2;
2068 SCROW nTestY2 = nY2;
2070 rDoc.
ExtendMerge( nX1,nY1, nTestX2,nTestY2, nTab );
2075 if (nTestX2 < nPosX || nTestY2 < nPosY)
2077 SCCOL nRealX1 = nX1;
2087 if (nXRight > rDoc.
MaxCol())
2091 if (nYBottom > rDoc.
MaxRow())
2092 nYBottom = rDoc.
MaxRow();
2095 if (nX1 > nXRight || nY1 > nYBottom)
2109 if (nX2 > nMaxTiledCol)
2111 if (nY2 > nMaxTiledRow)
2123 bool bWasHidden =
false;
2124 for (
SCROW nY=nY1; nY<=nY2; nY++)
2126 bool bFirstRow = ( nY == nPosY );
2127 bool bDoHidden =
false;
2128 sal_uInt16 nHeightTwips = rDoc.
GetRowHeight( nY,nTab );
2129 bool bDoRow = ( nHeightTwips != 0 );
2149 SCCOL nLoopEndX = nX2;
2152 SCCOL nStartX = nX1;
2163 for (
SCCOL nX=nX1; nX<=nLoopEndX; nX++)
2171 tools::Long nEndX = nScrX + ( nWidth - 1 ) * nLayoutSign;
2179 (rDoc.
RowHidden(nThisY-1, nTab) || bFirstRow) )
2182 pPattern = rDoc.
GetPattern( nX, nThisY, nTab );
2194 pPattern = rDoc.
GetPattern( nThisX, nThisY, nTab );
2208 Point aEndPos = bInPrintTwips ?
2211 if ( aEndPos.X() * nLayoutSign > nScrX * nLayoutSign && aEndPos.Y() > nScrY )
2214 aEndPos.X()-nLayoutSign,aEndPos.Y()-1 ) );
2217 else if ( nEndX * nLayoutSign >= nScrX * nLayoutSign && nEndY >= nScrY )
2224 nScrX = nEndX + nLayoutSign;
2234 Window::DataChanged(rDCEvt);
2236 if ( !((rDCEvt.
GetType() == DataChangedEventType::PRINTER) ||
2237 (rDCEvt.
GetType() == DataChangedEventType::DISPLAY) ||
2238 (rDCEvt.
GetType() == DataChangedEventType::FONTS) ||
2239 (rDCEvt.
GetType() == DataChangedEventType::FONTSUBSTITUTION) ||
2240 ((rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
2241 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE))) )
2247 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
2248 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
ScMarkData & GetMarkData()
const Fraction & GetScaleX() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetSyntaxMode(bool bNewMode)
void InvalidateLOKViewCursor(const tools::Rectangle &rCursorRect, const Fraction aScaleX, const Fraction aScaleY)
std::unique_ptr< RowInfo[]> mpRowInfo
void FillInfo(ScTableInfo &rTabInfo, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, double fColScale, double fRowScale, bool bPageMode, bool bFormulaMode, const ScMarkData *pMarkData=nullptr)
SCCOL GetColMerge() const
void DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo &rTabInfo, OutputDevice *pContentDev)
void SetPixelOffset(const Size &rOffset)
std::unique_ptr< ScNoteMarker, o3tl::default_delete< ScNoteMarker > > mpNoteMarker
void ExtendHidden(SCCOL &rX1, SCROW &rY1, SCCOL &rX2, SCROW &rY2, SCTAB nTab)
void SetFontSize(const Size &)
bool HasScenarioRange(SCTAB nTab, const ScRange &rRange) const
ScDocShell * GetDocShell() const
void DrawFrame(vcl::RenderContext &rRenderContext)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
void SetShowNullValues(bool bSet)
bool IsInInterpreter() const
ScDDComboBoxButton aComboButton
void flushOverlayManager()
static void lcl_DrawScenarioFrames(OutputDevice *pDev, ScViewData &rViewData, ScSplitPos eWhich, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2)
void EndDrawLayers(SdrPaintWindow &rPaintWindow, bool bPaintFormLayer)
MapMode GetDrawMapMode(bool bForce=false)
MapMode for the drawinglayer objects.
void setWidth(tools::Long nWidth)
void SetUseStyleColor(bool bSet)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
void GetRectsAnyFor(const ScMarkData &rMarkData,::std::vector< tools::Rectangle > &rRects, bool bInPrintTwips) const
tools::Rectangle GetListValButtonRect(const ScAddress &rButtonPos)
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const Fraction & GetZoomX() const
void LogicInvalidate(const tools::Rectangle *pRectangle) override
std::vector< LOKCursorEntry > maLOKLastCursor
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
const std::vector< ScHighlightEntry > & GetHighlightRanges() const
Point GetPrintTwipsPos(SCCOL nCol, SCROW nRow) const
returns the position (top-left corner) of the requested cell in print twips coordinates.
SC_DLLPUBLIC bool Intersects(const ScRange &rRange) const
SCROW GetRefStartY() const
void RepeatResize(bool bUpdateFix=true)
std::unique_ptr< FmFormView > mpLOKDrawView
LibreOfficeKit needs a persistent FmFormView for tiled rendering, otherwise the invalidations from dr...
const SCCOL * GetPageEndX() const
const StyleSettings & GetStyleSettings() const
svtools::ColorConfig & GetColorConfig()
bool IsOverlapped() const
void DrawRefMark(SCCOL nRefStartX, SCROW nRefStartY, SCCOL nRefEndX, SCROW nRefEndY, const Color &rColor, bool bHandle)
Draws reference mark and returns its properties.
bool IsMapModeEnabled() const
#define SC_SCENARIO_VSPACE
ViewShellDocId GetDocId() const override
virtual Size GetSizePixel() const
void AddRect(const tools::Rectangle &rRect)
ScPrintRangeData & GetData(size_t i)
const ContentProperties & rData
bool HasEditView(ScSplitPos eWhich) const
const MapMode & GetMapMode() const
constexpr SdrLayerID SC_LAYER_BACK(1)
bool IsSyntaxMode() const
DataChangedEventType GetType() const
ScSplitPos GetActivePart() const
static void UpdateInputLine()
void SetSolidBackground(bool bSet)
ScDocument & GetDocument() const
void SetShowFormulas(bool bSet)
void SetCellSelectionPixel(int nType, int nPixelX, int nPixelY)
Update the cell selection according to what handles have been dragged.
const tools::Rectangle & GetOutputArea() const
void SetMarkClipped(bool bSet)
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
void Invalidate(sal_uInt16 nId)
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
SCROW GetEditEndRow() const
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
SC_DLLPUBLIC SvtScriptType GetStringScriptType(const OUString &rString)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
SC_DLLPUBLIC ScBreakType HasRowBreak(SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
void SetContentDevice(OutputDevice *pContentDev)
void DrawPagePreview(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext &rRenderContext)
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
SC_DLLPUBLIC ScDocumentPool * GetPool()
HashMap_OWString_Interface aMap
const SCROW * GetPageEndY() const
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
tools::Rectangle aInvertRect
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
void disposeAndReset(VirtualDevice *pBody)
static tools::Long ToPixel(sal_uInt16 nTwips, double nFactor)
static void notifyInvalidation(SfxViewShell const *pThisView, const OString &rPayload)
void DrawSdrGrid(const tools::Rectangle &rDrawingRect, OutputDevice *pContentDev)
bool IsAutoFilterActive(SCCOL nCol, SCROW nRow, SCTAB nTab)
ScPageBreakData * GetPageBreakData()
void SetFmtDevice(OutputDevice *pRDev)
SC_DLLPUBLIC SCROW MaxRow() const
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const Fraction & GetScaleY() const
SC_DLLPUBLIC SCTAB GetTableCount() const
vcl::Cursor * GetCursor() const
OutputDevice & GetTargetOutputDevice()
void Draw(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMode eMode)
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
bool IsMultiMarked() const
void DrawContent(OutputDevice &rDevice, const ScTableInfo &rTableInfo, ScOutputData &aOutputData, bool bLogicText)
Draw content of the gridwindow; shared between the desktop and the tiled rendering.
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SC_DLLPUBLIC SCSIZE GetEntryCount() const
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
AllSettingsFlags GetFlags() const
bool isCompatFlagSet(Compat flag)
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
void SetDrawView(FmFormView *pNew)
void GetSelectionRectsPrintTwips(::std::vector< tools::Rectangle > &rRects) const
void DoneBlockMode(bool bContinue=false)
void PrepareFormulaCalc()
Call this before any operations that might trigger one or more formula cells to get calculated...
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
const Fraction & GetZoomY() const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
ScDrawView * GetScDrawView()
ScViewData & GetViewData()
ScChangeTrack * GetChangeTrack() const
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
void DrawRect(const tools::Rectangle &rRect)
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
void PutInOrder(T &nStart, T &nEnd)
void SetEditCell(SCCOL nCol, SCROW nRow)
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
ScTabViewShell * GetViewShell() const
void SetAlignment(FontAlign)
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC SCCOL MaxCol() const
bool IsVerOverlapped() const
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
void SetScaleX(const Fraction &rScaleX)
static void GetFont(vcl::Font &rFont, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
Static helper function to fill a font object from the passed item set.
SdrPaintWindow * BeginDrawLayers(OutputDevice *pOut, const vcl::Region &rReg, bool bDisableIntersect=false)
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
bool IsClipRegion() const
tools::Long GetFirstPage() const
SfxBindings & GetBindings()
void GetPosFromPixel(tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich, SCCOL &rPosX, SCROW &rPosY, bool bTestMerge=true, bool bRepair=false, SCTAB nForTab=-1)
bool ValidCol(SCCOL nCol) const
bool HasBackgroundDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
ScSplitPos GetEditActivePart() const
SC_DLLPUBLIC void GetTiledRenderingArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow) const
Return the number of columns / rows that should be visible for the tiled rendering.
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
ScSheetLimits & GetSheetLimits() const
void SetOrigin(const Point &rOrigin)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void DrawGrid(vcl::RenderContext &rRenderContext, bool bGrid, bool bPage)
const ScRange & GetPrintRange() const
tools::Long Width() const
void setLocalRendering(bool bLocalRendering=true)
void DrawBackground(vcl::RenderContext &rRenderContext)
void MarkScenario(SCTAB nSrcTab, SCTAB nDestTab, ScMarkData &rDestMark, bool bResetMark=true, ScScenarioFlags nNeededBits=ScScenarioFlags::NONE) const
OUString ScResId(const char *pId)
void DrawDocumentBackground()
vcl::Window * GetWindow() const
bool GetOption(ScViewOption eOpt) const
void SetScaleY(const Fraction &rScaleY)
const Size & GetFontSize() const
void DrawStrings(bool bPixelToLogic=false)
sal_uInt16 nCursorHideCount
const AllSettings & GetSettings() const
Size GetOutputSizePixel() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
void ResetChanged(const ScRange &rRange)
void GetPixelRectsFor(const ScMarkData &rMarkData,::std::vector< tools::Rectangle > &rPixelRects) const
convert rMarkData into pixel rectangles for this view
const sdr::contact::ObjectContact & GetObjectContact() const
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
bool UpdateVisibleRange()
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
void SetGridColor(const Color &rColor)
void SetColor(const Color &)
ScDBFunc * GetView() const
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
static SfxItemPool * CreatePool()
SCCOL GetRefStartX() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
void PaintTile(VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, tools::Long nTileWidth, tools::Long nTileHeight)
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
bool IsHorOverlapped() const
SCTAB GetRefStartZ() const
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
void DrawRedraw(ScOutputData &rOutputData, SdrLayerID nLayer)
SC_DLLPUBLIC void PutInOrder()
static SC_DLLPUBLIC SvtScriptType GetDefaultScriptType()
VisibleRange maVisibleRange
void SetShowSpellErrors(bool bSet)
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
ScDrawView * GetScDrawView()
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
SCCOL GetEditStartCol() const
void SetFont(const vcl::Font &rNewFont)
static void lcl_LimitRect(tools::Rectangle &rRect, const tools::Rectangle &rVisible)
virtual vcl::Region GetActiveClipRegion() const
constexpr SdrLayerID SC_LAYER_FRONT(0)
tools::Long GetTextHeight() const
SC_DLLPUBLIC ScBreakType HasColBreak(SCCOL nCol, SCTAB nTab) const
SvtScriptType nPageScript
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr SdrLayerID SC_LAYER_INTERN(2)
void SetViewShell(ScTabViewShell *pSh)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void SetSpellCheckContext(const sc::SpellCheckContext *pCxt)
tools::Long Height() const
const ScViewOptions & GetOptions() const
const value_type & getNearestByPosition(tools::Long nPos) const
void Paint(const tools::Rectangle &rRect, OutputDevice *pTargetDevice=nullptr)
SCCOL GetEditEndCol() const
SC_DLLPUBLIC const ScInputOptions & GetInputOptions()
static void lcl_DrawOneFrame(vcl::RenderContext *pDev, const tools::Rectangle &rInnerPixel, const OUString &rTitle, const Color &rColor, bool bTextBelow, double nPPTX, double nPPTY, const Fraction &rZoomY, ScDocument &rDoc, ScViewData &rButtonViewData, bool bLayoutRTL)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
const Point & GetOrigin() const
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...
SC_DLLPUBLIC void ExtendTotalMerge(ScRange &rRange) const
ScPositionHelper & GetLOKWidthHelper()
void DrawNoteMarks(vcl::RenderContext &rRenderContext)
tools::Long GetScrH() const
void SetMarking(bool bFlag)
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Color const & GetGridColor(OUString *pStrName=nullptr) const
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
const vcl::Font & GetAppFont() const
void SetOutputArea(const tools::Rectangle &rRect)
void setHeight(tools::Long nHeight)
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, std::vector< SCTAB > &tabs)
tools::Long GetScrW() const
void SetMirrorWidth(tools::Long nNew)
ScRangeFindData & GetObject(sal_uLong nIndex)
SCTAB GetRefTabNo() const
tools::Rectangle GetEditCursor() const
VirtualDevice * get() const
ScRangeList GetMarkedRanges() const
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
SCROW GetRowMerge() const
void GetMultiMarkArea(ScRange &rRange) const
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
void DoInvertRect(const tools::Rectangle &rPixel)
const MapMode & GetLogicMode(ScSplitPos eWhich)
tools::Rectangle aRepaintPixel
const OUString & GetDocName() const
ScPositionHelper & GetLOKHeightHelper()
void DrawEdit(bool bPixelToLogic)
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
void SetScenButSize(const Size &rNew)
SC_DLLPUBLIC void ExtendOverlapped(SCCOL &rStartCol, SCROW &rStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
bool IsPagebreakMode() const
bool NeedLOKCursorInvalidation(const tools::Rectangle &rCursorRect, const Fraction aScaleX, const Fraction aScaleY)
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
void GetSelectionRects(::std::vector< tools::Rectangle > &rPixelRects) const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Color const & GetBackgroundColor() const
void GetEditView(ScSplitPos eWhich, EditView *&rViewPtr, SCCOL &rCol, SCROW &rRow)
void UpdateHeaderOverlay()
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
std::shared_ptr< sc::SpellCheckContext > mpSpellCheckCxt
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
void SetPagebreakMode(ScPageBreakData *pPageData)
SCROW GetEditStartRow() const
void FillEditItemSet(SfxItemSet *pEditSet, const SfxItemSet *pCondSet=nullptr) const
Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSe...
#define SC_SCENARIO_HSPACE
static void lcl_DrawHighlight(ScOutputData &rOutputData, const ScViewData &rViewData, const std::vector< ScHighlightEntry > &rHighlightRanges)