20#include <config_features.h>
41#include <osl/diagnose.h>
44#include <viewfunc.hxx>
58#include <stlsheet.hxx>
65#include <compiler.hxx>
74#include <tokenarray.hxx>
86 SCROW nFirstRow = nStartNo;
87 SCROW nLastRow = nStartNo;
90 if (!rDoc.
RowFiltered(nFirstRow, nTab,
nullptr, &nLastRow))
91 rDoc.
ShowRows(nFirstRow, nLastRow < nEndNo ? nLastRow : nEndNo, nTab, bShow);
92 nFirstRow = nLastRow + 1;
93 }
while (nFirstRow <= nEndNo);
107 ScTabView( pParent, rDocSh, pViewShell ),
108 bFormatValid( false )
118void collectUIInformation(std::map<OUString, OUString>&& aParameters,
const OUString& rAction)
121 aDescription.
aID =
"grid_window";
122 aDescription.
aAction = rAction;
124 aDescription.
aParent =
"MainWindow";
125 aDescription.
aKeyWord =
"ScGridWinUIObject";
135 if ( !
SC_MOD()->GetInputOptions().GetExtendFormat() )
141 if ( bOk && aMarkRange.
aStart != aMarkRange.
aEnd )
157 if ( !
SC_MOD()->GetInputOptions().GetExtendFormat() )
229 ScRange aRange( nCol, nRow, nTab, nCol, nRow, nTab );
238 if ( pSrcStyle && pSrcStyle != pOldPattern->
GetStyleSheet() )
270 nPPTX,
nPPTY, aZoomX, aZoomY, bFormula, &rMark );
287 pOnlyNotBecauseOfMatrix );
311 if (pOldList[
nPos] == nOpCode)
318 for (sal_uInt16 nCopy=
nPos; nCopy>0; nCopy--)
319 pOldList[nCopy] = pOldList[nCopy-1];
320 pOldList[0] = nOpCode;
328 sal_uInt16 nNewCount = std::min(
static_cast<sal_uInt16
>(nOldCount + 1), sal_uInt16(
LRU_MAX) );
330 nNewList[0] = nOpCode;
341 SCCOL nCol,
SCROW nRow,
const OUString& rType =
"cell-change")
346 for (
const auto& rTab : rMark)
350 Notify(*pModelObj, aChangeRanges, rType);
354 ? OUString(
"data-area-invalidate") : OUString(
"data-area-extend"));
364 std::unique_ptr<weld::TextView> m_xError;
366 AutoCorrectQuery(
weld::Window* pParent,
const OUString& rFormula)
367 :
weld::MessageDialogController(pParent,
"modules/scalc/ui/warnautocorrect.ui",
"WarnAutoCorrect",
"grid")
368 , m_xError(m_xBuilder->weld_text_view(
"error"))
370 m_xDialog->set_default_response(RET_YES);
372 const int nMaxWidth = m_xError->get_approximate_digit_width() * 65;
373 const int nMaxHeight = m_xError->get_height_rows(6);
374 m_xError->set_size_request(nMaxWidth, nMaxHeight);
376 m_xError->set_text(rFormula);
385 const OUString& rString,
409 bool bFormula =
false;
415 if ( pFormatter->
GetType(format) != SvNumFormatType::TEXT && rString.getLength() > 1 )
417 if ( rString[0] ==
'=' )
422 else if ( rString[0] ==
'+' || rString[0] ==
'-' )
426 sal_Int32 nLen = rString.getLength();
431 OUString aString = rString.replaceAt( 1,
nIndex - 1,
u"" );
435 if ( aString.getLength() > 1 )
446 bool bNumFmtChanged =
false;
454 if ( rString[0] ==
'+' || rString[0] ==
'-' )
458 OUString aFormula( rString );
459 std::unique_ptr< ScTokenArray > pArr;
464 bool bAddEqual =
false;
467 std::unique_ptr< ScTokenArray > pArrFirst;
470 pArrFirst = std::move( pArr );
473 if ( pArr->GetCodeError() == FormulaError::NONE )
481 OUString aCorrectedFormula;
489 if ( aCorrectedFormula.getLength() == 1 )
493 AutoCorrectQuery aQueryBox(
GetViewData().GetDialogParent(), aCorrectedFormula);
494 nResult = aQueryBox.run();
498 aFormula = aCorrectedFormula;
504 pArr = std::move( pArrFirst );
516 if ( nError == FormulaError::NONE )
523 bool bOptChanged =
false;
526 sal_uInt16 nTokens = pArr->GetLen();
527 sal_uInt16 nLevel = 0;
528 for (sal_uInt16 nTP=0; nTP<nTokens; nTP++)
534 else if ( eOp ==
ocClose && nLevel )
572 for (
const auto& rTab : rMark)
579 if (
nType == SvNumFormatType::TEXT ||
580 ((rString[0] ==
'+' || rString[0] ==
'-') && nError != FormulaError::NONE && rString == aFormula))
593 if ( nError != FormulaError::NONE )
600 if (
nType == SvNumFormatType::LOGICAL)
608 const sal_uInt32 nFormat = pFormatter->
GetStandardFormat( SvNumFormatType::NUMBER, nLang);
615 bNumFmtChanged =
true;
624 for (
const auto& rTab : rMark)
626 bool bNumFmtSet =
false;
627 const ScAddress aScAddress(nCol, nRow, rTab);
645 bNumFmtChanged =
true;
650 bool bAutoFormat =
TestFormatArea(nCol, nRow, nTab, bNumFmtChanged);
657 const OUString aType(rString.isEmpty() ?
u"delete-content" :
u"cell-change");
686 aUndoCell.
assign(rDoc, aPos);
688 rDoc.
SetValue( nCol, nRow, nTab, rValue );
694 std::make_unique<ScUndoEnterValue>(pDocSh, aPos, aUndoCell, rValue));
721 bool bSimple =
false;
722 bool bCommon =
false;
723 std::unique_ptr<ScPatternAttr> pCellAttrs;
741 OUString aParStr(aEngine.
GetText( 0 ));
742 if ( aParStr[0] ==
'=' )
749 pCellAttrs->GetFromEditItemSet( &aAttrTester.
GetAttribs() );
759 std::unique_ptr<EditTextObject> pUndoData;
762 if (bRecord && !bSimple)
764 for (
const auto& rTab : rMark)
767 aOldValue.
mnTab = rTab;
769 aOldValues.push_back(aOldValue);
772 pUndoData = rData.
Clone();
785 EnterData( nCol, nRow, nTab, aString,
nullptr,
true );
789 for (
const auto& rTab : rMark)
798 std::make_unique<ScUndoEnterData>(pDocSh,
ScAddress(nCol,nRow,nTab), aOldValues, aString, std::move(pUndoData)));
805 for (
const auto& rTab : rMark)
814 const OUString aType(bIsEmpty ?
u"delete-content" :
u"cell-change");
834 EnterData( nPosX, nPosY, nTab, rString );
857 if ( nSizeX != 0 && nSizeY != 0 &&
858 nCol+nSizeX-1 <= sal::static_int_cast<SCSIZE>(rDoc.
MaxCol()) &&
859 nRow+nSizeY-1 <= sal::static_int_cast<SCSIZE>(rDoc.
MaxRow()) )
861 ScRange aResult( nCol, nRow, nTab,
862 sal::static_int_cast<SCCOL>(nCol+nSizeX-1),
863 sal::static_int_cast<SCROW>(nRow+nSizeY-1), nTab );
873 aRange, &rMark,
nullptr, rString,
false,
false, OUString(), eGram );
903 if (nScript == SvtScriptType::NONE)
944 std::shared_ptr<SvxBoxItem>& rLineOuter,
945 std::shared_ptr<SvxBoxInfoItem>& rLineInner )
964 rLineInner->SetTable(
false);
965 rLineInner->SetDist(
true);
966 rLineInner->SetMinDist(
false);
976 bool bAdjustBlockHeight)
979 bool bOnlyNotBecauseOfMatrix;
980 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
992 sal_uInt32 nOldFormat =
994 sal_uInt32 nNewFormat =
996 if ( nNewFormat != nOldFormat )
1006 if ( eNewLang != eOldLang )
1031 pNewPool->
Put(rNewOuter);
1032 pNewPool->
Put(rNewInner);
1046 if (&rNewOuter == &rOldOuter && &rNewInner == &rOldInner)
1051 if (bFrame && rNewOuter == rOldOuter && rNewInner == rOldInner)
1055 && ( rNewInner.
IsValid(SvxBoxInfoItemValidFlags::LEFT)
1056 || rNewInner.
IsValid(SvxBoxInfoItemValidFlags::RIGHT)
1057 || rNewInner.
IsValid(SvxBoxInfoItemValidFlags::TOP)
1058 || rNewInner.
IsValid(SvxBoxInfoItemValidFlags::BOTTOM)
1059 || rNewInner.
IsValid(SvxBoxInfoItemValidFlags::HORI)
1060 || rNewInner.
IsValid(SvxBoxInfoItemValidFlags::VERT) );
1072 bDefNewOuter ? rOldOuter : rNewOuter,
1073 bDefNewInner ? &rOldInner : &rNewInner );
1076 pNewPool->
Remove(rNewOuter);
1077 pNewPool->
Remove(rNewInner);
1080 if (bAdjustBlockHeight)
1089 bool bOnlyNotBecauseOfMatrix;
1090 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
1106 if (bAdjustBlockHeight)
1120 bool bRecord =
true;
1125 ScRange aMarkRange, aMarkRangeWithEnvelope;
1141 if( bRemoveAdjCellBorder )
1144 aMarkRangeWithEnvelope = aMarkRange;
1155 bool bCopyOnlyMarked =
false;
1156 if( !bRemoveAdjCellBorder )
1157 bCopyOnlyMarked = bMulti;
1158 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab );
1159 for (
const auto& rTab : aFuncMark)
1160 if (rTab != nStartTab)
1161 pUndoDoc->AddUndoTab( rTab, rTab );
1163 ScRange aCopyRange = aMarkRangeWithEnvelope;
1169 std::make_unique<ScUndoSelectionAttr>(
1173 std::move(pUndoDoc), bCopyOnlyMarked, &rAttr, &rNewOuter, pNewInner, &aMarkRangeWithEnvelope ) );
1236 bool bRecord =
true;
1249 sal_uInt16 nExtFlags = 0;
1275 for (
const auto& rTab : aFuncMark)
1277 ScRange aChangeRange( aMarkRange );
1280 aChangeRanges.
push_back( aChangeRange );
1293 ScRange aCopyRange = aMarkRange;
1298 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab );
1299 for (
const auto& rTab : aFuncMark)
1300 if (rTab != nStartTab)
1301 pUndoDoc->AddUndoTab( rTab, rTab );
1304 aFuncMark.MarkToMulti();
1307 pDocSh, aFuncMark, nStartCol, nStartRow, nStartTab,
1308 nEndCol, nEndRow, nEndTab, std::move(pUndoDoc), bMulti, &rAttr );
1315 pDocSh->
PostPaint( nStartCol, nStartRow, nStartTab,
1316 nEndCol, nEndRow, nEndTab,
1328 std::unique_ptr<EditTextObject> pOldEditData;
1329 std::unique_ptr<EditTextObject> pNewEditData;
1335 pOldEditData = pEditObj->
Clone();
1338 pNewEditData = pEditObj->
Clone();
1342 std::optional<ScPatternAttr> pOldPat(*rDoc.
GetPattern( nCol, nRow, nTab ));
1351 pDocSh, nCol, nRow, nTab, &*pOldPat, pNewPat, &rAttr ));
1352 pUndo->SetEditData(std::move(pOldEditData), std::move(pNewEditData));
1367 css::uno::Sequence< css::beans::PropertyValue >
aProperties;
1373 if ( rNewSet.
GetItemState( nWhich,
true, &pItem ) == SfxItemState::SET && pItem )
1377 if ( pEntry->nWID == nWhich )
1380 pItem->
QueryValue( aVal, pEntry->nMemberId );
1383 pProperties[
nCount ].Name = pEntry->aName;
1384 pProperties[
nCount ].Value = aVal;
1400 bool bOnlyNotBecauseOfMatrix;
1401 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
1409 rNewSet.
Put( rItemSet,
false );
1438 bool bOnlyNotBecauseOfMatrix;
1439 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
1445 if ( !pStyleSheet)
return;
1453 bool bRecord =
true;
1468 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1469 for (
const auto& rTab : aFuncMark)
1471 pUndoDoc->AddUndoTab( rTab, rTab );
1473 ScRange aCopyRange = aMarkRange;
1477 aFuncMark.MarkToMulti();
1481 std::make_unique<ScUndoSelectionStyle>( pDocSh, aFuncMark, aMarkRange,
aName, std::move(pUndoDoc) ) );
1500 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1501 for (
const auto& rTab : aFuncMark)
1503 pUndoDoc->AddUndoTab( rTab, rTab );
1505 ScRange aCopyRange( nCol, nRow, 0, nCol, nRow, nTabCount-1 );
1508 ScRange aMarkRange ( nCol, nRow, nTab );
1514 std::make_unique<ScUndoSelectionStyle>( pDocSh, aUndoMark, aMarkRange,
aName, std::move(pUndoDoc) ) );
1517 for (
const auto& rTab : aFuncMark)
1532 if ( !pStyleSheet)
return;
1541 pVirtDev->SetMapMode(
MapMode(MapUnit::MapPixel));
1558 if ( !pStyleSheet)
return;
1567 pVirtDev->SetMapMode(
MapMode(MapUnit::MapPixel));
1594 if (pTabViewShell && pTabViewShell->
GetDocId() == pCurrentViewShell->
GetDocId())
1597 pPosHelper->invalidateByIndex(nStartCol);
1601 if (pTabViewShell !=
this)
1603 if (pTabViewShell->
getPart() == nCurrentTabIndex)
1606 if (nX > nStartCol || (nX == nStartCol && nOffset > 0))
1610 pTabViewShell->
SetCursor(nX + nOffset, nY);
1629 if (nX > nStartCol || (nX == nStartCol && nOffset > 0))
1651 if (pTabViewShell && pTabViewShell->
GetDocId() == pCurrentViewShell->
GetDocId())
1654 pPosHelper->invalidateByIndex(nStartRow);
1658 if (pTabViewShell !=
this)
1660 if (pTabViewShell->
getPart() == nCurrentTabIndex)
1663 if (nY > nStartRow || (nY == nStartRow && nOffset > 0))
1667 pTabViewShell->
SetCursor(nX, nY + nOffset);
1686 if (nY > nStartRow || (nY == nStartRow && nOffset > 0))
1708 if (pTabViewShell && pTabViewShell->
GetDocId() == pCurrentViewShell->
GetDocId())
1713 pPosHelper->invalidateByIndex(nStart);
1718 pPosHelper->invalidateByIndex(nStart);
1735 bool bSuccess = pDocSh->
GetDocFunc().
InsertCells( aRange, &rMark, eCmd, bRecord,
false, bPartOfPaste );
1745 if ( bInsertCols || bInsertRows )
1747 OUString aOperation = bInsertRows ?
1748 OUString(
"insert-rows"):
1749 OUString(
"insert-columns");
1762 bInsertCols, bInsertRows,
true ,
1769 collectUIInformation({{
"RANGE", aStartAddress +
":" + aEndAddress}},
"INSERT_CELLS");
1789#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
1822 OUString(
"delete-rows"):
1823 OUString(
"delete-columns");
1847 bColsDeleted, bRowsDeleted,
true ,
1864 collectUIInformation({{
"RANGE", aStartAddress +
":" + aEndAddress}},
"DELETE_CELLS");
1878 bool bRecord =
true;
1882 std::vector<sc::ColRowSpan> aSpans;
1891 aSpans.emplace_back(nCurPos, nCurPos);
1897 bool bNeedRefresh =
false;
1898 for (
size_t i = 0,
n = aSpans.size();
i <
n && !pErrorId; ++
i)
1903 SCCOL nStartCol, nEndCol;
1904 SCROW nStartRow, nEndRow;
1909 nStartRow =
static_cast<SCROW>(nStart);
1910 nEndRow =
static_cast<SCROW>(nEnd);
1914 nStartCol =
static_cast<SCCOL>(nStart);
1915 nEndCol =
static_cast<SCCOL>(nEnd);
1930 SCCOL nMergeStartX = nStartCol;
1931 SCROW nMergeStartY = nStartRow;
1932 SCCOL nMergeEndX = nEndCol;
1933 SCROW nMergeEndY = nEndRow;
1934 rDoc.
ExtendMerge( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
1935 rDoc.
ExtendOverlapped( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
1937 if ( nMergeStartX != nStartCol || nMergeStartY != nStartRow )
1942 pErrorId = STR_MSSG_DELETECELLS_0;
1944 if ( nMergeEndX != nEndCol || nMergeEndY != nEndRow )
1948 bNeedRefresh =
true;
1965 std::unique_ptr<ScRefUndoData> pUndoData;
1969 pUndoDoc->InitUndo( rDoc, nTab, nTab, !bRows, bRows );
1985 pUndoDoc->AddUndoTab( 0, nTabCount-1 );
1993 std::vector<sc::ColRowSpan>::const_reverse_iterator ri = aSpans.rbegin(), riEnd = aSpans.rend();
1995 for (; ri != riEnd; ++ri)
2014 SCCOLROW nFirstStart = aSpans[0].mnStart;
2015 SCCOL nStartCol = bRows ? 0 :
static_cast<SCCOL>(nFirstStart);
2016 SCROW nStartRow = bRows ?
static_cast<SCROW>(nFirstStart) : 0;
2021 rDoc.
ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab,
true );
2027 std::make_unique<ScUndoDeleteMulti>(
2028 pDocSh, bRows, bNeedRefresh, nTab, std::vector(aSpans), std::move(pUndoDoc), std::move(pUndoData)));
2055 nCurY = aSpans[0].mnStart;
2057 nCurX =
static_cast<SCCOL>(aSpans[0].mnStart);
2072 bool bOnlyNotBecauseOfMatrix;
2076 if ( !(bOnlyNotBecauseOfMatrix &&
2079 ErrorMessage(bOnlyNotBecauseOfMatrix ? STR_MATRIXFRAGMENTERR : STR_PROTECTIONERR);
2085 bool bSimple =
false;
2154 collectUIInformation({{
"RANGE", aStartAddress +
":" + aEndAddress}},
"DELETE");
2160 bool bWidth,
const std::vector<sc::ColRowSpan>& rRanges,
ScSizeMode eMode,
2161 sal_uInt16 nSizeTwips,
bool bRecord,
const ScMarkData* pMarkData )
2163 if (rRanges.empty())
2181 bool bAllowed =
true;
2182 for (
const SCTAB& nTab : aMarkData)
2184 bAllowed = std::all_of(rRanges.begin(), rRanges.end(),
2187 bool bIsBlockEditable;
2189 bIsBlockEditable = rDoc.IsBlockEditable(nTab, rRange.mnStart, 0, rRange.mnEnd, rDoc.MaxRow(), &bOnlyMatrix);
2191 bIsBlockEditable = rDoc.IsBlockEditable(nTab, 0, rRange.mnStart, rDoc.MaxCol(), rRange.mnEnd, &bOnlyMatrix);
2192 return bIsBlockEditable || bOnlyMatrix;
2206 SCCOLROW nStart = rRanges.front().mnStart;
2207 SCCOLROW nEnd = rRanges.back().mnEnd;
2211 bool bFormula =
false;
2219 std::unique_ptr<ScOutlineTable> pUndoTab;
2220 std::vector<sc::ColRowSpan> aUndoRanges;
2227 for (
const SCTAB& nTab : aMarkData)
2231 if ( nTab == nFirstTab )
2232 pUndoDoc->InitUndo( rDoc, nTab, nTab,
true );
2234 pUndoDoc->AddUndoTab( nTab, nTab,
true );
2241 if ( nTab == nFirstTab )
2242 pUndoDoc->InitUndo( rDoc, nTab, nTab,
false,
true );
2244 pUndoDoc->AddUndoTab( nTab, nTab,
false,
true );
2249 aUndoRanges = rRanges;
2261 bool bOutline =
false;
2263 for (
const SCTAB& nTab : aMarkData)
2267 SCCOLROW nStartNo = rRange.mnStart;
2275 bool bFiltered =
false;
2280 for (
SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow)
2282 SCROW nLastRow = nRow;
2283 if (rDoc.
RowHidden(nRow, nTab,
nullptr, &nLastRow))
2296 SCROW nLastRow = nStartNo;
2297 if (rDoc.
RowFiltered(nStartNo, nTab,
nullptr, &nLastRow)
2298 || nLastRow < nEndNo)
2313 aZoomX = aZoomY =
Fraction( 1, 1 );
2338 if (!bShow && nStartNo <= nCurY && nCurY <= nEndNo && nTab == nCurTab)
2345 rDoc.
ShowRows( nStartNo, nEndNo, nTab,
true );
2350 for (
SCCOL nCol=
static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
2352 const bool bIsColHidden = rDoc.
ColHidden(nCol, nTab);
2355 sal_uInt16 nThisSize = nSizeTwips;
2364 rDoc.
ShowCol(nCol, nTab, !bIsColHidden);
2366 rDoc.
ShowCol( nCol, nTab, bShow );
2368 if (!bShow && nCol == nCurX && nTab == nCurTab)
2380 static_cast<SCCOL>(nEndNo), nTab, bShow ) )
2398 std::make_unique<ScUndoWidthOrHeight>(
2399 pDocSh, aMarkData, nStart, nCurTab, nEnd, nCurTab,
2400 std::move(pUndoDoc), std::move(aUndoRanges), std::move(pUndoTab),
eMode, nSizeTwips, bWidth));
2417 for (
const SCTAB& nTab : aMarkData)
2423 true , bAffectsVisibility , bAffectsVisibility ,
2428 for (
const SCTAB& nTab : aMarkData)
2465 for (
const SCTAB& nTab : aMarkData)
2469 SCCOL nStartCol = rRange.mnStart;
2470 SCCOL nEndCol = rRange.mnEnd;
2471 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
2492 const ScRange aMarkRange( nCol, nRow, nTab);
2499 std::vector<sc::ColRowSpan> aRanges =
2517 bool bAllowed, bOnlyMatrix;
2522 if ( !bAllowed && !bOnlyMatrix )
2535 sal_uInt16 nWidth = rDoc.
GetColWidth( nCol, nTab );
2554 nMargin = sal::static_int_cast<sal_uInt16>(
2574 aZoomX = aZoomY =
Fraction( 1, 1 );
2579 sal_uInt16 nTwips =
static_cast<sal_uInt16
>(
nPixel /
nPPTX );
2589 nWidth = sal::static_int_cast<sal_uInt16>( nWidth + nStepX );
2590 else if ( nWidth > nStepX )
2591 nWidth = sal::static_int_cast<sal_uInt16>( nWidth - nStepX );
2592 if ( nWidth < nStepX ) nWidth = nStepX;
2595 aRange[0].mnStart = nCol;
2596 aRange[0].mnEnd = nCol;
2623 nHeight = sal::static_int_cast<sal_uInt16>( nHeight + nStepY );
2624 else if ( nHeight > nStepY )
2625 nHeight = sal::static_int_cast<sal_uInt16>( nHeight - nStepY );
2626 if ( nHeight < nStepY ) nHeight = nStepY;
2629 aRange[0].mnStart = nRow;
2630 aRange[0].mnEnd = nRow;
2663 OUString aUndo =
ScResId( STR_UNDO_PROTECT_TAB );
2667 for (
const auto& rTab : rMark)
2694 bool bChanged =
false;
2699 bChanged = rFunc.
Unprotect( nTab, rPassword,
false );
2709 OUString aUndo =
ScResId( STR_UNDO_UNPROTECT_TAB );
2713 for (
const auto& rTab : rMark)
2715 if ( rFunc.
Unprotect( rTab, rPassword,
false ) )
2745 bool bOnlyNotBecauseOfMatrix;
2746 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
2752 sal_uInt32 nNumberFormat = 0;
2768 nNumberFormat = pNumberFormatter->
GetStandardFormat( nFormatType, eLanguage ) + nAdd;
2779 bool bOnlyNotBecauseOfMatrix;
2780 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
2800 sal_uInt32 nNumberFormat = pFormatter->
GetEntryKey( rCode, eLanguage );
2805 OUString aFormat = rCode;
2806 sal_Int32 nErrPos = 0;
2808 bOk = pFormatter->
PutEntry( aFormat, nErrPos,
nType, nNumberFormat, eLanguage );
2826 bool bOnlyNotBecauseOfMatrix;
2827 if ( !
SelectionEditable( &bOnlyNotBecauseOfMatrix ) && !bOnlyNotBecauseOfMatrix )
2844 OSL_FAIL(
"numberformat not found !!!");
2850 sal_uInt32 nNewFormat = nOldFormat;
2851 bool bError =
false;
2854 bool bThousand, bNegRed;
2855 sal_uInt16 nPrecision, nLeading;
2859 if ( SvNumFormatType::ALL == ( nOldType & (
2860 SvNumFormatType::NUMBER | SvNumFormatType::CURRENCY | SvNumFormatType::PERCENT | SvNumFormatType::SCIENTIFIC | SvNumFormatType::TIME ) ) )
2867 bool bWasStandard = ( nOldFormat == pFormatter->
GetStandardIndex( eLanguage ) );
2868 OUString sExponentialStandardFormat =
"";
2878 const_cast<SvNumberformat*
>(pOldEntry)->GetOutputString( nVal, aOut, &pCol );
2882 sal_Int32 nIndexE = aOut.indexOf(
'E');
2885 sExponentialStandardFormat = aOut.copy( nIndexE ).replace(
'-',
'+' );
2886 for ( sal_Int32
i=1 ;
i<sExponentialStandardFormat.getLength() ;
i++ )
2888 if ( sExponentialStandardFormat[
i] >=
'1' && sExponentialStandardFormat[
i] <=
'9' )
2889 sExponentialStandardFormat = sExponentialStandardFormat.replaceAt(
i, 1,
u"0" );
2891 aOut = aOut.copy( 0, nIndexE );
2894 sal_Int32
nPos = aOut.indexOf( aDecSep );
2896 nPrecision = aOut.getLength() -
nPos - aDecSep.getLength();
2901 if ( (nOldType & SvNumFormatType::SCIENTIFIC) && !bThousand &&
2926 OUString aNewPicture = pFormatter->
GenerateFormat(nOldFormat, eLanguage,
2928 nPrecision, nLeading)
2929 + sExponentialStandardFormat;
2931 nNewFormat = pFormatter->
GetEntryKey( aNewPicture, eLanguage );
2934 sal_Int32 nErrPos = 0;
2936 bool bOk = pFormatter->
PutEntry( aNewPicture, nErrPos,
2937 nNewType, nNewFormat, eLanguage );
2938 OSL_ENSURE( bOk,
"incorrect numberformat generated" );
2980 rBindings.
Invalidate( SID_ATTR_ALIGN_INDENT );
2985 const OUString& rType )
2997 auto pNewEntry = std::make_unique<ScRangeData>(
3000 OUString aUpType = rType.toAsciiUpperCase();
3001 if ( aUpType.indexOf(
'P' ) != -1 )
3003 if ( aUpType.indexOf(
'R' ) != -1 )
3005 if ( aUpType.indexOf(
'C' ) != -1 )
3007 if ( aUpType.indexOf(
'F' ) != -1 )
3009 pNewEntry->AddType(
nType);
3011 if ( pNewEntry->GetErrCode() == FormulaError::NONE )
3026 if ( pList->
insert( pNewEntry.release() ) )
3053 SCCOL nStartCol, nEndCol;
3054 SCROW nStartRow, nEndRow;
3065 SCCOL nFirstCol = nStartCol;
3066 SCCOL nLastCol = nEndCol;
3067 if (nStartCol+1 < nEndCol) { ++nFirstCol; --nLastCol; }
3068 for (
i=nFirstCol;
i<=nLastCol && bOk;
i++)
3076 for (
i=nFirstCol;
i<=nLastCol && bOk;
i++)
3084 SCROW nFirstRow = nStartRow;
3085 SCROW nLastRow = nEndRow;
3086 if (nStartRow+1 < nEndRow) { ++nFirstRow; --nLastRow; }
3087 for (j=nFirstRow; j<=nLastRow && bOk; j++)
3095 for (j=nFirstRow; j<=nLastRow && bOk; j++)
3103 if (nStartCol == nEndCol)
3105 if (nStartRow == nEndRow)
3128 bool bSetLines =
false;
3129 bool bSetAlign =
false;
3138 sal_uInt16 nExtFlags = 0;
3150 pDocShell->
PostPaint( nStartCol, nStartRow, nStartTab,
3151 nEndCol, nEndRow, nEndTab,
PropertiesInfo aProperties
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 ...
SfxApplication * SfxGetpApp()
Reference< XExecutableDialog > m_xDialog
OUString GetText(LineEnd eEnd=LINEEND_LF) const
std::unique_ptr< EditTextObject > CreateTextObject()
virtual sal_Int32 GetParagraphCount() const=0
virtual OUString GetText(sal_Int32 nPara) const=0
virtual std::unique_ptr< EditTextObject > Clone() const=0
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
OUString GetColRowString() const
Create a human-readable string representation of the cell address.
sal_uInt16 GetLRUFuncListCount() const
void SetLRUFuncList(const sal_uInt16 *pList, const sal_uInt16 nCount)
sal_uInt16 * GetLRUFuncList() const
static const SfxItemPropertyMap & GetCellPropertyMap()
void SetAutoCorrection(bool bVal)
When auto correction is set, the jump command reorder must be enabled.
@ EXTENDED_ERROR_DETECTION_NAME_BREAK
const OUString & GetCorrectedFormula() const
void SetExtendedErrorDetection(ExtendedErrorDetection eVal)
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
bool Protect(SCTAB nTab, const OUString &rPassword)
bool SetNormalString(bool &o_rbNumFmtSet, const ScAddress &rPos, const OUString &rText, bool bApi)
bool SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell, bool bInteraction)
Below two methods take ownership of the formula cell instance(s).
bool ChangeIndent(const ScMarkData &rMark, bool bIncrement, bool bApi)
bool CreateNames(const ScRange &rRange, CreateNameFlags nFlags, bool bApi, SCTAB nTab=-1)
bool InsertCells(const ScRange &rRange, const ScMarkData *pTabMark, InsCellCmd eCmd, bool bRecord, bool bApi, bool bPartOfPaste=false)
void ProtectSheet(SCTAB nTab, const ScTableProtection &rProtect)
bool SetStringCell(const ScAddress &rPos, const OUString &rStr, bool bInteraction)
bool DeleteCells(const ScRange &rRange, const ScMarkData *pTabMark, DelCellCmd eCmd, bool bApi)
void EnterListAction(TranslateId pNameResId)
SC_DLLPUBLIC bool DeleteContents(const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
bool ApplyStyle(const ScMarkData &rMark, const OUString &rStyleName, bool bApi)
void SetNoteText(const ScAddress &rPos, const OUString &rNoteText, bool bApi)
bool ApplyAttributes(const ScMarkData &rMark, const ScPatternAttr &rPattern, bool bApi)
bool SetEditCell(const ScAddress &rPos, const EditTextObject &rStr, bool bInteraction)
bool InsertNameList(const ScAddress &rStartPos, bool bApi)
bool DeleteCell(const ScAddress &rPos, const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
SC_DLLPUBLIC bool EnterMatrix(const ScRange &rRange, const ScMarkData *pTabMark, const ScTokenArray *pTokenArray, const OUString &rString, bool bApi, bool bEnglish, const OUString &rFormulaNmsp, const formula::FormulaGrammar::Grammar)
bool Unprotect(SCTAB nTab, const OUString &rPassword, bool bApi)
void ReplaceNote(const ScAddress &rPos, const OUString &rNoteText, const OUString *pAuthor, const OUString *pDate, bool bApi)
Create before modifications of the document and destroy thereafter.
void SetDocumentModified()
void PostPaintCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
const ScDocument & GetDocument() const
void UpdatePaintExt(sal_uInt16 &rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab)
void UpdateOle(const ScViewData &rViewData, bool bSnapSize=false)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
ScModelObj * GetModel() const
double GetOutputFactor() const
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
virtual SfxUndoManager * GetUndoManager() override
SC_DLLPUBLIC SfxItemPool * GetEnginePool() const
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
ScSheetLimits & GetSheetLimits() const
const ScStyleSheet * GetSelectionStyle(const ScMarkData &rMark) const
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool UpdateOutlineCol(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bShow)
Adapt Outline.
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
void UpdatePageBreaks(SCTAB nTab, const ScRange *pUserArea=nullptr)
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
bool ShrinkToDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow) const
Shrink a range to only include data area.
bool IsSelectionEditable(const ScMarkData &rMark, bool *pOnlyNotBecauseOfMatrix=nullptr) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
SC_DLLPUBLIC bool SetOptimalHeight(sc::RowHeightContext &rCxt, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bApi)
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC SCROW MaxRow() const
const ScStyleSheet * GetStyle(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
sal_uInt16 GetSheetOptimalMinRowHeight(SCTAB nTab) const
SC_DLLPUBLIC void ApplySelectionStyle(const ScStyleSheet &rStyle, const ScMarkData &rMark)
SC_DLLPUBLIC void PreprocessRangeNameUpdate()
SC_DLLPUBLIC void SetRowHeightRange(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
SC_DLLPUBLIC SfxItemPool * GetEditPool() const
SC_DLLPUBLIC void ShowCol(SCCOL nCol, SCTAB nTab, bool bShow)
SC_DLLPUBLIC bool HasStringData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool UpdateOutlineRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bShow)
void DeleteRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, bool *pUndoOutline=nullptr, const ScMarkData *pTabMark=nullptr)
void GetSelectionFrame(const ScMarkData &rMark, SvxBoxItem &rLineOuter, SvxBoxInfoItem &rLineInner)
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
SC_DLLPUBLIC void ApplySelectionPattern(const ScPatternAttr &rAttr, const ScMarkData &rMark, ScEditDataArray *pDataArray=nullptr, bool *pIsChanged=nullptr)
SC_DLLPUBLIC void ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, bool bShow)
sal_uInt16 GetOptimalColWidth(SCCOL nCol, SCTAB nTab, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY, bool bFormula, const ScMarkData *pMarkData=nullptr, const ScColWidthParam *pParam=nullptr)
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 ScConditionalFormat * GetCondFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
bool IsBlockEditable(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
void DeleteObjectsInArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, bool bAnchored=false)
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, InsertDeleteFlags nFlags, bool bMarked, ScDocument &rDestDoc, const ScMarkData *pMarks=nullptr, bool bColRowFlags=true)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
void ApplyStyle(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScStyleSheet &rStyle)
void ApplySelectionFrame(const ScMarkData &rMark, const SvxBoxItem &rLineOuter, const SvxBoxInfoItem *pLineInner)
SC_DLLPUBLIC ScOutlineTable * GetOutlineTable(SCTAB nTab, bool bCreate=false)
void StyleSheetChanged(const SfxStyleSheetBase *pStyleSheet, bool bRemoved, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY)
void RemoveEditTextCharAttribs(const ScAddress &rPos, const ScPatternAttr &rAttr)
SvtScriptType GetRangeScriptType(sc::ColumnBlockPosition &rBlockPos, const ScAddress &rPos, SCROW nLength)
SC_DLLPUBLIC const EditTextObject * GetEditText(const ScAddress &rPos) const
SC_DLLPUBLIC void ExtendOverlapped(SCCOL &rStartCol, SCROW &rStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
void DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, bool *pUndoOutline=nullptr, const ScMarkData *pTabMark=nullptr)
SC_DLLPUBLIC void SetRowFlags(SCROW nRow, SCTAB nTab, CRFlags nNewFlags)
SC_DLLPUBLIC SvtScriptType GetScriptType(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScRefCellValue *pCell=nullptr)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
SC_DLLPUBLIC void SetManualHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bManual)
SC_DLLPUBLIC void SetColWidth(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
bool IsUndoEnabled() const
const ScPatternAttr * GetSelectionPattern(const ScMarkData &rMark)
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
tools::Long GetNeededSize(SCCOL nCol, SCROW nRow, SCTAB nTab, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY, bool bWidth, bool bTotalSize=false, bool bInPrintTwips=false)
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC SCTAB GetTableCount() const
const SfxItemSet & GetAttribs() const
bool NeedsCellAttr() const
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
static OUString GetMultilineString(const EditEngine &rEngine)
Retrieves string with paragraphs delimited by new lines (' ').
TranslateId GetMessageId() const
sal_uInt16 nFIndex
Unique function index.
List of spreadsheet functions.
const ScFuncDesc * GetFunction(sal_uInt32 nIndex) const
sal_uInt32 GetCount() const
static SC_DLLPUBLIC LanguageType eLnge
static ScFunctionList * GetStarCalcFunctionList()
static SC_DLLPUBLIC SvtScriptType GetDefaultScriptType()
static SC_DLLPUBLIC const CharClass & getCharClass()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMultiMarkArea() const
void SelectTable(SCTAB nTab, bool bNew)
const ScRange & GetMarkArea() const
void ShiftRows(const ScDocument &rDoc, SCROW nStartRow, sal_Int32 nRowOffset)
SCTAB GetFirstSelected() const
void SelectOneTable(SCTAB nTab)
bool IsMultiMarked() const
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
void SetMarking(bool bFlag)
void SetMultiMarkArea(const ScRange &rRange, bool bMark=true, bool bSetupMulti=false)
void GetSelectionCover(ScRange &rRange)
void ShiftCols(const ScDocument &rDoc, SCCOL nStartCol, sal_Int32 nColOffset)
std::vector< sc::ColRowSpan > GetMarkedColSpans() const
SCTAB GetSelectCount() const
void SetMarkArea(const ScRange &rRange)
std::vector< sc::ColRowSpan > GetMarkedRowSpans() const
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
SC_DLLPUBLIC const ScAppOptions & GetAppOptions()
SC_DLLPUBLIC void SetAppOptions(const ScAppOptions &rOpt)
const ScStyleSheet * GetStyleSheet() const
void DeleteUnchanged(const ScPatternAttr *pOldAttrs)
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
void SetIndex(sal_uInt16 nInd)
void push_back(const ScRange &rRange)
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
void erase(const ScRangeData &r)
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
OutputDevice * GetDevice() const
static bool SC_DLLPUBLIC isMultiline(std::u16string_view rStr)
static void notifyAllViewsSheetGeomInvalidation(const SfxViewShell *pForViewShell, bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab is equal to nCurrentTa...
static void notifyAllViewsHeaderInvalidation(const SfxViewShell *pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex.
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
int getPart() const override
See SfxViewShell::getPart().
const ScInputHandler * GetInputHandler() const
void DoneBlockMode(bool bContinue=false)
void ErrorMessage(TranslateId pGlobStrId)
SC_DLLPUBLIC void RefreshZoom()
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
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)
ScViewData & GetViewData()
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
void ResetAutoSpellForContentChange()
void UpdateCopySourceOverlay()
SC_DLLPUBLIC void CellContentChanged()
void SetMarkData(const ScMarkData &rNew)
void InitOwnBlockMode(const ScRange &rMarkRange)
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
void SetTabProtectionSymbol(SCTAB nTab, const bool bProtect)
sheet protection state container
std::vector< Value > ValuesType
ScEditDataArray * GetDataArray()
const ScViewOptions & GetOptions() const
ScDocFunc & GetDocFunc() const
ScMarkData & GetMarkData()
SCROW GetCurYForTab(SCTAB nTabIndex) const
SCCOL GetCurXForTab(SCTAB nTabIndex) const
const Fraction & GetZoomY() const
void SetCurYForTab(SCCOL nNewCurY, SCTAB nTabIndex)
ScDocument & GetDocument() const
ScPositionHelper & GetLOKHeightHelper()
ScDocShell * GetDocShell() const
void SetCurXForTab(SCCOL nNewCurX, SCTAB nTabIndex)
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
ScDBFunc * GetView() const
ScPositionHelper & GetLOKWidthHelper()
void SetPasteMode(ScPasteFlags nFlags)
const Fraction & GetZoomX() const
SfxBindings & GetBindings()
bool SelectionEditable(bool *pOnlyNotBecauseOfMatrix=nullptr)
void SetNumFmtByStr(const OUString &rCode)
void DeleteCells(DelCellCmd eCmd)
void ReplaceNote(const ScAddress &rPos, const OUString &rNoteText, const OUString *pAuthor, const OUString *pDate)
void SetMarkedWidthOrHeight(bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips)
void EnterData(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const EditTextObject *pData=nullptr, bool bMatrixExpand=false)
void EnterDataAtCursor(const OUString &rString)
void SetStyleSheetToMarked(const SfxStyleSheet *pStyleSheet)
void ApplyUserItemSet(const SfxItemSet &rItemSet)
sal_uInt16 GetOptimalColWidth(SCCOL nCol, SCTAB nTab, bool bFormula)
ScViewFunc(vcl::Window *pParent, ScDocShell &rDocSh, ScTabViewShell *pViewShell)
void ApplyPatternLines(const ScPatternAttr &rAttr, const SvxBoxItem &rNewOuter, const SvxBoxInfoItem *pNewInner)
bool InsertCells(InsCellCmd eCmd, bool bRecord=true, bool bPartOfPaste=false)
bool TestFormatArea(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bAttrChanged)
void SetWidthOrHeight(bool bWidth, const std::vector< sc::ColRowSpan > &rRanges, ScSizeMode eMode, sal_uInt16 nSizeTwips, bool bRecord=true, const ScMarkData *pMarkData=nullptr)
void ProtectSheet(SCTAB nTab, const ScTableProtection &rProtect)
void SetNumberFormat(SvNumFormatType nFormatType, sal_uLong nAdd=0)
bool Unprotect(SCTAB nTab, const OUString &rPassword)
const SfxStyleSheet * GetStyleSheetFromMarked()
SvtScriptType GetSelectionScriptType()
void EnterValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rValue)
void ProtectDoc(const OUString &rPassword)
void RemoveStyleSheetInUse(const SfxStyleSheetBase *pStyleSheet)
void ApplySelectionPattern(const ScPatternAttr &rAttr, bool bCursorOnly=false)
void DeleteMulti(bool bRows)
SC_DLLPUBLIC const ScPatternAttr * GetSelectionPattern()
void DeleteContents(InsertDeleteFlags nFlags)
void UpdateSelectionArea(const ScMarkData &rSel, ScPatternAttr *pAttr=nullptr)
bool AdjustBlockHeight(bool bPaint=true, ScMarkData *pMarkData=nullptr)
void OnLOKInsertDeleteColumn(SCCOL nStartCol, tools::Long nOffset)
void UpdateStyleSheetInUse(const SfxStyleSheetBase *pStyleSheet)
void CreateNames(CreateNameFlags nFlags)
void OnLOKInsertDeleteRow(SCROW nStartRow, tools::Long nOffset)
void ChangeNumFmtDecimals(bool bIncrement)
void EnterMatrix(const OUString &rString, ::formula::FormulaGrammar::Grammar eGram)
void GetSelectionFrame(std::shared_ptr< SvxBoxItem > &rLineOuter, std::shared_ptr< SvxBoxInfoItem > &rLineInner)
void ModifyCellSize(ScDirection eDir, bool bOptimal)
void SetNoteText(const ScAddress &rPos, const OUString &rNoteText)
void ApplyAttr(const SfxPoolItem &rAttrItem, bool bAdjustBlockHeight=true)
void DoAutoAttributes(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bAttrChanged)
void OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
bool InsertName(const OUString &rName, const OUString &rSymbol, const OUString &rType)
CreateNameFlags GetCreateNameFlags()
void ApplyAttributes(const SfxItemSet *pDialogSet, const SfxItemSet *pOldSet, bool bAdjustBlockHeight=true)
void ChangeIndent(bool bIncrement)
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, bool bApi)
bool GetOption(ScViewOption eOpt) const
static void UnmarkFiltered(ScMarkData &rMark, const ScDocument &rDoc)
void Invalidate(sal_uInt16 nId)
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
void Remove(const SfxPoolItem &)
const o3tl::sorted_vector< const SfxItemPropertyMapEntry *, SfxItemPropertyMapCompare > & getPropertyEntries() const
SfxItemPool * GetPool() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const OUString & GetName() const
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
ViewShellDocId GetDocId() const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
constexpr tools::Long Width() const
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
bool IsRemoveAdjacentCellBorder() const
sal_Int16 GetRightMargin() const
sal_Int16 GetLeftMargin() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
void setExtraHeight(sal_uInt16 nH)
void setForceAutoSize(bool b)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
constexpr sal_Int32 MAX_COL_WIDTH
@ EDITATTR
Drawing objects.
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
constexpr sal_Int32 STD_EXTRA_WIDTH
constexpr sal_Int32 MAX_ROW_HEIGHT
constexpr sal_Int32 STD_COL_WIDTH
#define LANGUAGE_DONTKNOW
std::unique_ptr< sal_Int32[]> pData
bool isDataAreaInvalidateType(std::u16string_view rType)
void NotifyIfChangesListeners(const ScDocShell &rDocShell, const ScRange &rRange, const OUString &rType=OUString("cell-change"))
void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, const OUString &rType=OUString("cell-change"), const css::uno::Sequence< css::beans::PropertyValue > &rProperties=css::uno::Sequence< css::beans::PropertyValue >())
bool getMustPropagateChangesModel(ScModelObj *pModelObj)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
bool IsStaticDefaultItem(const SfxPoolItem *pItem)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
constexpr TypedWhichId< SvxLanguageItem > ATTR_LANGUAGE_FORMAT(147)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr sal_uInt16 ATTR_PATTERN_START(100)
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
constexpr TypedWhichId< SvxLanguageItem > ATTR_FONT_LANGUAGE(110)
constexpr sal_uInt16 ATTR_PATTERN_END(155)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
std::map< OUString, OUString > aParameters
Store arbitrary cell value of any kind.
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
const EditTextObject * getEditText() const
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
@ SC_MARK_SIMPLE_FILTERED
static void lcl_PostRepaintCondFormat(const ScConditionalFormat *pCondFmt, ScDocShell *pDocSh)
static void ShrinkToDataArea(ScMarkData &rFuncMark, ScDocument &rDoc)
static bool lcl_AddFunction(ScAppOptions &rAppOpt, sal_uInt16 nOpCode)
static bool lcl_FunctionKnown(sal_uInt16 nOpCode)
static void ShowFilteredRows(ScDocument &rDoc, SCTAB nTab, SCCOLROW nStartNo, SCCOLROW nEndNo, bool bShow)
#define SV_COUNTRY_LANGUAGE_OFFSET
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND
#define SV_MAX_COUNT_STANDARD_FORMATS