20#include <config_features.h>
22#include <com/sun/star/i18n/TextConversionOption.hpp>
23#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
53#include <document.hxx>
86#include <tokenarray.hxx>
92#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
93#include <com/sun/star/lang/XInitialization.hpp>
94#include <com/sun/star/beans/XPropertySet.hpp>
95#include <com/sun/star/uno/XComponentContext.hpp>
109 OUString aFlagsStr = rFlagsStr.toAsciiUpperCase();
112 for (sal_Int32 i=0 ;
i < aFlagsStr.getLength(); ++
i)
114 switch (aFlagsStr[i])
140 nFlags &= nFlagsMask;
153void SetTabNoAndCursor(
const ScViewData& rViewData, std::u16string_view rCellId )
156 assert(pTabViewShell);
158 std::vector<sc::NoteEntry> aNotes;
164 const auto& aFoundNoteIt = std::find_if(aNotes.begin(), aNotes.end(), lComp);
165 if (aFoundNoteIt != aNotes.end())
167 ScAddress aFoundPos = aFoundNoteIt->maPos;
234 sal_uInt16 nSlot = rReq.
GetSlot();
243 case FID_DEFINE_NAME:
246 case FID_INSERT_NAME:
247 case SID_SPELL_DIALOG:
248 case SID_HANGUL_HANJA_CONVERSION:
249 case SID_OPENDLG_CONDFRMT:
250 case SID_OPENDLG_CURRENTCONDFRMT:
251 case SID_OPENDLG_COLORSCALE:
252 case SID_OPENDLG_DATABAR:
268 case FID_INS_ROWS_BEFORE:
274 case FID_INS_COLUMNS_BEFORE:
279 case FID_INS_ROWS_AFTER:
284 case FID_INS_COLUMNS_AFTER:
289 case FID_INS_CELLSDOWN:
294 case FID_INS_CELLSRIGHT:
318 if( pReqArgs->
HasItem( FID_INS_CELL, &pItem ) )
320 if( !aFlags.isEmpty() )
345 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
349 InsertCells(pTabViewShell, aRequest, pDlg->GetInsCellCmd());
356 InsertCells(pTabViewShell, rReq, eCmd);
360 case FID_DELETE_CELL:
369 if( pReqArgs->
HasItem( FID_DELETE_CELL, &pItem ) )
371 if( !aFlags.isEmpty() )
399 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
403 DeleteCells(pTabViewShell, aRequest, pDlg->GetDelCellCmd());
409 DeleteCells(pTabViewShell, rReq, eCmd);
415 case SID_DELETE_CONTENTS:
427 OUString aFlags(
'A');
429 if( pReqArgs->
HasItem( SID_DELETE, &pItem ) )
445 pDlg->DisableObjects();
446 if (pDlg->Execute() ==
RET_OK)
448 nFlags = pDlg->GetDelContentsCmdBits();
472 case FID_FILL_TO_BOTTOM:
477 case FID_FILL_TO_RIGHT:
482 case FID_FILL_TO_TOP:
487 case FID_FILL_TO_LEFT:
496 bool bSkipEmpty =
false;
497 bool bAsLink =
false;
502 OUString aFlags(
'A');
504 if( pReqArgs->
HasItem( FID_FILL_TAB, &pItem ) )
507 nFlags |= FlagsFromString(aFlags);
514 new OUString(
ScResId(STR_FILL_TAB))));
515 pDlg->SetFillMode(
true);
517 if (pDlg->Execute() ==
RET_OK)
519 nFlags = pDlg->GetInsContentsCmdBits();
520 nFunction = pDlg->GetFormulaCmdBits();
521 bSkipEmpty = pDlg->IsSkipEmptyCells();
522 bAsLink = pDlg->IsLink();
529 pTabViewShell->
FillTab( nFlags, nFunction, bSkipEmpty, bAsLink );
533 OUString aFlags = FlagsToString( nFlags );
542 case FID_FILL_SERIES:
566 nEndCol, nEndRow, nEndTab );
568 if( nStartCol!=nEndCol )
574 if( nStartRow!=nEndRow )
586 OUString aFillDir, aFillCmd, aFillDateCmd;
587 OUString aFillStep, aFillStart, aFillMax;
591 if( pReqArgs->
HasItem( FID_FILL_SERIES, &pItem ) )
593 if( pReqArgs->
HasItem( FN_PARAM_1, &pItem ) )
595 if( pReqArgs->
HasItem( FN_PARAM_2, &pItem ) )
597 if( pReqArgs->
HasItem( FN_PARAM_3, &pItem ) )
599 if( pReqArgs->
HasItem( FN_PARAM_4, &pItem ) )
601 if( pReqArgs->
HasItem( FN_PARAM_5, &pItem ) )
604 if( !aFillDir.isEmpty() )
605 switch( aFillDir[0] )
613 if( !aFillCmd.isEmpty() )
614 switch( aFillCmd[0] )
619 case 'D':
case 'd': eFillCmd=
FILL_DATE;
break;
620 case 'A':
case 'a': eFillCmd=
FILL_AUTO;
break;
623 if( !aFillDateCmd.isEmpty() )
624 switch( aFillDateCmd[0] )
626 case 'D':
case 'd': eFillDateCmd=
FILL_DAY;
break;
628 case 'M':
case 'm': eFillDateCmd=
FILL_MONTH;
break;
629 case 'Y':
case 'y': eFillDateCmd=
FILL_YEAR;
break;
649 sal_uInt32 nPrivFormat = rDoc.
GetNumberFormat( nStartCol, nStartRow, nStartTab );
652 const SCSIZE nSelectHeight = nEndRow - nStartRow + 1;
653 const SCSIZE nSelectWidth = nEndCol - nStartCol + 1;
657 OSL_FAIL(
"Numberformat not found !!!");
662 if (nPrivType & SvNumFormatType::DATE)
675 if ( nStartCol == nEndCol || nStartRow == nEndRow )
677 double fInputEndVal = 0.0;
680 const bool forceSystemLocale =
true;
681 aStartStr = rDoc.
GetInputString( nStartCol, nStartRow, nStartTab, forceSystemLocale );
682 fStartVal = rDoc.
GetValue( nStartCol, nStartRow, nStartTab );
686 aEndStr = rDoc.
GetInputString( nStartCol, nStartRow+1, nStartTab, forceSystemLocale );
687 if(!aEndStr.isEmpty())
689 fInputEndVal = rDoc.
GetValue( nStartCol, nStartRow+1, nStartTab );
690 fIncVal=fInputEndVal-fStartVal;
695 if(nStartCol < nEndCol)
697 aEndStr = rDoc.
GetInputString( nStartCol+1, nStartRow, nStartTab, forceSystemLocale );
698 if(!aEndStr.isEmpty())
700 fInputEndVal = rDoc.
GetValue( nStartCol+1, nStartRow, nStartTab );
701 fIncVal=fInputEndVal-fStartVal;
708 Date aStartDate = rNullDate;
710 Date aEndDate = rNullDate;
711 aEndDate.
AddDays(fInputEndVal);
734 eFillDir, eFillCmd, eFillDateCmd,
735 aStartStr, fIncVal, fMaxVal,
736 nSelectHeight, nSelectWidth, nPossDir));
738 if ( nStartCol != nEndCol && nStartRow != nEndRow )
740 pDlg->SetEdStartValEnabled(
false);
743 if ( pDlg->Execute() ==
RET_OK )
745 eFillDir = pDlg->GetFillDir();
746 eFillCmd = pDlg->GetFillCmd();
747 eFillDateCmd = pDlg->GetFillDateCmd();
751 OUString
aStr = pDlg->GetStartStr();
753 pTabViewShell->
EnterData( nStartCol, nStartRow, nStartTab,
aStr );
755 fStartVal = pDlg->GetStart();
756 fIncVal = pDlg->GetStep();
757 fMaxVal = pDlg->GetMax();
765 pTabViewShell->
FillSeries( eFillDir, eFillCmd, eFillDateCmd, fStartVal, fIncVal, fMaxVal );
770 const Color* pColor =
nullptr;
793 switch( eFillDateCmd )
833 if( pReqArgs !=
nullptr )
838 OUString aArg = pItem->GetValue();
842 nFillRow = aScAddress.
Row();
843 nFillCol = aScAddress.
Col();
847 SCTAB nStartTab, nEndTab;
849 nEndCol,nEndRow,nEndTab );
855 if ( nStartCol == nEndCol && nStartRow == nEndRow )
857 SCCOL nMergeCol = nStartCol;
858 SCROW nMergeRow = nStartRow;
860 nStartCol, nStartRow, nMergeCol, nMergeRow,
863 if ( nFillCol >= nStartCol && nFillCol <= nMergeCol && nFillRow == nStartRow )
864 nFillCol = nStartCol;
865 if ( nFillRow >= nStartRow && nFillRow <= nMergeRow && nFillCol == nStartCol )
866 nFillRow = nStartRow;
871 if ( nFillCol != nEndCol || nFillRow != nEndRow )
873 if ( nFillCol==nEndCol || nFillRow==nEndRow )
878 if ( nFillCol==nEndCol )
880 if ( nFillRow > nEndRow )
883 nCount = nFillRow - nEndRow;
885 else if ( nFillRow < nStartRow )
888 nCount = nStartRow - nFillRow;
893 if ( nFillCol > nEndCol )
896 nCount = nFillCol - nEndCol;
898 else if ( nFillCol < nStartCol )
901 nCount = nStartCol - nFillCol;
907 pTabViewShell->
FillAuto( eDir, nStartCol, nStartRow, nEndCol, nEndRow,
nCount );
922 OSL_FAIL(
"Direction not unique for autofill" );
927 case FID_FILL_SINGLE_EDIT:
930 case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
940 case SID_SAMPLING_DIALOG:
949 case SID_DESCRIPTIVE_STATISTICS_DIALOG:
958 case SID_ANALYSIS_OF_VARIANCE_DIALOG:
967 case SID_CORRELATION_DIALOG:
976 case SID_COVARIANCE_DIALOG:
985 case SID_EXPONENTIAL_SMOOTHING_DIALOG:
994 case SID_MOVING_AVERAGE_DIALOG:
1003 case SID_REGRESSION_DIALOG:
1012 case SID_TTEST_DIALOG:
1022 case SID_FTEST_DIALOG:
1032 case SID_ZTEST_DIALOG:
1042 case SID_CHI_SQUARE_TEST_DIALOG:
1052 case SID_FOURIER_ANALYSIS_DIALOG:
1062 case SID_SEARCH_RESULTS_DIALOG:
1065 if (pReqArgs && pReqArgs->
HasItem(SID_SEARCH_RESULTS_DIALOG, &pItem))
1070 sal_uInt16
nId = sc::SearchResultsDlgWrapper::GetChildWindowId();
1077 case SID_INSERT_SPARKLINE:
1078 case SID_EDIT_SPARKLINE_GROUP:
1088 case SID_EDIT_SPARKLINE:
1098 case SID_DELETE_SPARKLINE:
1106 case SID_DELETE_SPARKLINE_GROUP:
1112 std::shared_ptr<sc::SparklineGroup> pSparklineGroup;
1113 if (
GetViewData().GetDocument().GetSparklineGroupInRange(aMarkRange, pSparklineGroup) && pSparklineGroup)
1122 case SID_GROUP_SPARKLINES:
1131 auto const& rpSparklineGroup = pSparkline->getSparklineGroup();
1139 case SID_UNGROUP_SPARKLINES:
1153 case SID_OUTLINE_HIDE:
1162 case SID_OUTLINE_SHOW:
1168 Sequence<sheet::DataPilotFieldFilter> aFilters;
1169 css::sheet::DataPilotFieldOrientation nOrientation;
1174 pTabViewShell->
GetFrameWeld(), *pDPObj, nOrientation ) );
1175 if ( pDlg->Execute() ==
RET_OK )
1177 OUString aNewDimName( pDlg->GetDimensionName() );
1195 case SID_OUTLINE_MAKE:
1197 bool bColumns =
false;
1207 sal_Int32 nParts = 0;
1214 aNumInfo, nParts, rNullDate ) );
1215 if( pDlg->Execute() ==
RET_OK )
1217 aNumInfo = pDlg->GetGroupInfo();
1226 if( pDlg->Execute() ==
RET_OK )
1234 else if( pReqArgs !=
nullptr )
1239 if( pReqArgs->
HasItem( SID_OUTLINE_MAKE, &pItem ) )
1242 aCol = aCol.toAsciiUpperCase();
1246 case 'R': bColumns=
false; bOk =
true;
break;
1247 case 'C': bColumns=
true; bOk =
true;
break;
1263 pDlg->StartExecuteAsync(
1264 [pDlg, pTabViewShell] (sal_Int32 nResult) {
1267 bool bColumn = pDlg->GetColsChecked();
1270 pDlg->disposeOnce();
1281 if( ! rReq.
IsAPI() )
1283 OUString aCol = bColumns ? OUString(
'C') : OUString(
'R');
1291 case SID_OUTLINE_REMOVE:
1293 bool bColumns =
false;
1302 else if( pReqArgs !=
nullptr )
1307 if( pReqArgs->
HasItem( SID_OUTLINE_REMOVE, &pItem ) )
1310 aCol = aCol.toAsciiUpperCase();
1314 case 'R': bColumns=
false; bOk =
true;
break;
1315 case 'C': bColumns=
true; bOk =
true;
break;
1321 bool bColPoss, bRowPoss;
1330 pDlg->StartExecuteAsync(
1331 [pDlg, pTabViewShell] (sal_Int32 nResult) {
1334 bool bColumn = pDlg->GetColsChecked();
1337 pDlg->disposeOnce();
1343 else if ( bColPoss )
1345 else if ( bRowPoss )
1354 if( ! rReq.
IsAPI() )
1356 OUString aCol = bColumns ? OUString(
'C') : OUString(
'R');
1369 pTabViewShell->
CopyToClip(
nullptr,
false,
false,
true );
1395 case SID_CLIPBOARD_FORMAT_ITEMS:
1401 if ( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
1402 if (
auto pIntItem =
dynamic_cast<const SfxUInt32Item*
>(pItem) )
1405 if ( nFormat != SotClipboardFormatId::NONE )
1410 bool bOle = ( nFormat == SotClipboardFormatId::EMBED_SOURCE );
1412 if ( bCells && bOle )
1414 else if ( bDraw && bOle )
1427 case FID_INS_CELL_CONTENTS:
1438 bool bSkipEmpty =
false;
1439 bool bTranspose =
false;
1440 bool bAsLink =
false;
1445 OUString aFlags(
'A');
1447 if( pReqArgs->
HasItem( FID_INS_CELL_CONTENTS, &pItem ) )
1450 nFlags |= FlagsFromString(aFlags);
1460 bSkipEmpty = pSkipItem->
GetValue();
1461 if ( pTransposeItem )
1462 bTranspose = pTransposeItem->GetValue();
1464 bAsLink = pLinkItem->GetValue();
1466 eMoveMode =
static_cast<InsCellCmd>(pMoveItem->GetValue());
1476 pDlg->SetOtherDoc( bOtherDoc );
1485 SCCOL nStartX, nEndX, nClipStartX, nClipSizeX, nRangeSizeX;
1486 SCROW nStartY, nEndY, nClipStartY, nClipSizeY, nRangeSizeY;
1487 SCTAB nStartTab, nEndTab;
1493 nStartTab != nEndTab )
1497 nStartX = nEndX = rData.
GetCurX();
1498 nStartY = nEndY = rData.
GetCurY();
1503 nRangeSizeX = nClipSizeX >= nEndX - nStartX ? nClipSizeX : nEndX - nStartX;
1504 nRangeSizeY = nClipSizeY >= nEndY - nStartY ? nClipSizeY : nEndY - nStartY;
1508 ScRange aSource( nClipStartX, nClipStartY, nStartTab,
1509 nClipStartX + nClipSizeX, nClipStartY + nClipSizeY, nStartTab );
1510 ScRange aDest( nStartX, nStartY, nStartTab,
1511 nStartX + nRangeSizeX, nStartY + nRangeSizeY, nStartTab );
1524 rDoc.
MaxCol() - nRangeSizeX, nStartY,
1525 rDoc.
MaxCol(), nStartY + nRangeSizeY,
1531 nStartX, rDoc.
MaxRow() - nRangeSizeY,
1532 nStartX + nRangeSizeX, rDoc.
MaxRow(),
1537 pDlg->SetCellShiftDisabled( nDisableShiftX | nDisableShiftY );
1541 if (pDlg->Execute() ==
RET_OK)
1543 nFlags = pDlg->GetInsContentsCmdBits();
1544 nFunction = pDlg->GetFormulaCmdBits();
1545 bSkipEmpty = pDlg->IsSkipEmptyCells();
1546 bTranspose = pDlg->IsTranspose();
1547 bAsLink = pDlg->IsLink();
1548 eMoveMode = pDlg->GetMoveMode();
1559 if ( bAsLink && bOtherDoc )
1564 nFunction, bSkipEmpty, bTranspose, bAsLink,
1571 OUString aFlags = FlagsToString( nFlags );
1586 case SID_PASTE_ONLY_VALUE:
1587 case SID_PASTE_ONLY_TEXT:
1588 case SID_PASTE_ONLY_FORMULA:
1592 rReq.
SetSlot( FID_INS_CELL_CONTENTS );
1594 if ( nSlot == SID_PASTE_ONLY_VALUE )
1596 else if ( nSlot == SID_PASTE_ONLY_TEXT )
1609 case SID_PASTE_TRANSPOSED:
1614 rReq.
SetSlot(FID_INS_CELL_CONTENTS);
1626 case SID_PASTE_AS_LINK:
1631 rReq.
SetSlot(FID_INS_CELL_CONTENTS);
1644 case SID_PASTE_TEXTIMPORT_DIALOG:
1649 const uno::Reference<datatransfer::XTransferable>& xTransferable
1652 bool bSuccess =
false;
1655 OUString sStrBuffer;
1656 bSuccess = aDataHelper.
GetString(format, sStrBuffer);
1659 auto pStrm = std::make_shared<ScImportStringStream>(sStrBuffer);
1677 auto pObj = std::make_shared<ScImportExport>(
GetViewData().GetDocument(), aCellPos);
1678 pObj->SetOverwriting(
true);
1679 if (pDlg->Execute()) {
1681 pDlg->GetOptions(aOptions);
1682 pDlg->SaveParameters();
1683 pObj->SetExtOptions(aOptions);
1684 pObj->ImportString(sStrBuffer, format);
1686 pDlg->disposeOnce();
1698 case SID_PASTE_SPECIAL:
1708 pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET &&
1716 if ( bDraw && nFormat == SotClipboardFormatId::EMBED_SOURCE )
1736 rReq.
SetSlot( FID_INS_CELL_CONTENTS );
1747 sal_uInt16 nFormatCount = aFormats.
Count();
1752 for (sal_uInt16
i=0;
i<nFormatCount;
i++)
1757 if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE )
1759 pDlg->Insert( nFormatId,
aName );
1767 pDlg->InsertUno(
".uno:PasteTextImportDialog", sLabel);
1772 if (nFormat != SotClipboardFormatId::NONE)
1776 if ( bDraw && nFormat == SotClipboardFormatId::EMBED_SOURCE )
1799 case SID_PASTE_UNFORMATTED:
1810 SotClipboardFormatId::STRING_TSVC : SotClipboardFormatId::STRING;
1829 case FID_INS_ROWBRK:
1834 case FID_INS_COLBRK:
1839 case FID_DEL_ROWBRK:
1844 case FID_DEL_COLBRK:
1849 case SID_DETECTIVE_ADD_PRED:
1854 case SID_DETECTIVE_DEL_PRED:
1859 case SID_DETECTIVE_ADD_SUCC:
1864 case SID_DETECTIVE_DEL_SUCC:
1869 case SID_DETECTIVE_ADD_ERR:
1874 case SID_DETECTIVE_INVALID:
1879 case SID_DETECTIVE_REFRESH:
1884 case SID_DETECTIVE_MARK_PRED:
1887 case SID_DETECTIVE_MARK_SUCC:
1890 case SID_INSERT_CURRENT_DATE:
1892 SvNumFormatType::DATE,
ScResId(STR_UNDO_INSERT_CURRENT_DATE));
1894 case SID_INSERT_CURRENT_TIME:
1896 SvNumFormatType::TIME,
ScResId(STR_UNDO_INSERT_CURRENT_TIME));
1899 case SID_SPELL_DIALOG:
1914 case SID_HANGUL_HANJA_CONVERSION:
1918 case SID_CHINESE_CONVERSION:
1921 Reference< XComponentContext > xContext(
1922 ::cppu::defaultBootstrap_InitialComponentContext() );
1925 Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
1928 Reference< ui::dialogs::XExecutableDialog > xDialog(
1929 xMCF->createInstanceWithContext(
1930 "com.sun.star.linguistic2.ChineseTranslationDialog"
1933 Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
1939 {
"ParentWindow",
uno::Any(Reference< awt::XWindow >())}
1941 xInit->initialize(
aSeq );
1944 sal_Int16 nDialogRet = xDialog->execute();
1945 if(
RET_OK == nDialogRet )
1948 bool bToSimplified =
true;
1949 bool bUseVariants =
true;
1950 bool bCommonTerms =
true;
1951 Reference< beans::XPropertySet > xProp( xDialog, UNO_QUERY );
1956 xProp->getPropertyValue(
"IsDirectionToSimplified") >>= bToSimplified;
1957 xProp->getPropertyValue(
"IsUseCharacterVariants") >>= bUseVariants;
1958 xProp->getPropertyValue(
"IsTranslateCommonTerms") >>= bCommonTerms;
1968 sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
1970 nOptions |= i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
1973 DefaultFontType::CJK_SPREADSHEET,
1974 eTargetLang, GetDefaultFontFlags::OnlyOne );
1976 eSourceLang, eTargetLang, std::move(aTargetFont), nOptions,
false );
1980 Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY );
1981 if( xComponent.is() )
1982 xComponent->dispose();
1988 case SID_CONVERT_FORMULA_TO_VALUE:
1997 case SID_TOGGLE_REL:
2001 case SID_DEC_INDENT:
2004 case SID_INC_INDENT:
2016 if( pDlg->Execute() )
2024 case SID_CONSOLIDATE:
2027 if ( pReqArgs && (pItem =
2037#if HAVE_FEATURE_SCRIPTING
2038 else if (rReq.
IsAPI())
2044 case SID_INS_FUNCTION:
2065 case FID_DEFINE_NAME:
2066 case FID_DEFINE_CURRENT_NAME:
2070 OUString
aName, aSymbol, aAttrib;
2072 if( pReqArgs->
HasItem( FID_DEFINE_NAME, &pItem ) )
2075 if( pReqArgs->
HasItem( FN_PARAM_1, &pItem ) )
2078 if( pReqArgs->
HasItem( FN_PARAM_2, &pItem ) )
2081 if ( !
aName.isEmpty() && !aSymbol.isEmpty() )
2085#if HAVE_FEATURE_SCRIPTING
2093 sal_uInt16
nId = ScNameDlgWrapper::GetChildWindowId();
2102 sal_uInt16
nId = ScNameDefDlgWrapper::GetChildWindowId();
2110 case SID_OPENDLG_CONDFRMT:
2111 case SID_OPENDLG_CURRENTCONDFRMT:
2112 case SID_OPENDLG_COLORSCALE:
2113 case SID_OPENDLG_DATABAR:
2114 case SID_OPENDLG_ICONSET:
2115 case SID_OPENDLG_CONDDATE:
2117 sal_uInt32
nIndex = sal_uInt32(-1);
2118 bool bManaged =
false;
2122 if (itemsRange.begin() != itemsRange.end())
2133 sal_uInt16
nId = ScCondFormatDlgWrapper::GetChildWindowId();
2148 pTabViewShell->
ErrorMessage( STR_ERR_CONDFORMAT_PROTECTED );
2153 if(aRangeList.
empty())
2163 bool bContainsCondFormat = !rCondFormats.
empty();
2164 bool bCondFormatDlg =
false;
2165 bool bContainsExistingCondFormat =
false;
2166 if(bContainsCondFormat)
2168 for (
const auto& rCondFormat : rCondFormats)
2171 pCondFormat = pList->
GetFormat(rCondFormat);
2175 bContainsExistingCondFormat =
true;
2177 if(rCondFormatRange == aRangeList)
2180 bCondFormatDlg =
true;
2189 if (pParam && nSlot == SID_OPENDLG_ICONSET)
2191 auto pFormat = std::make_unique<ScConditionalFormat>(0, &rDoc);
2192 pFormat->SetRange(aRangeList);
2209 pFormat->AddEntry(pEntry);
2219 if(bContainsCondFormat && !bCondFormatDlg && bContainsExistingCondFormat)
2222 VclMessageType::Question, VclButtonsType::YesNo,
2223 ScResId(STR_EDIT_EXISTING_COND_FORMATS)));
2224 xQueryBox->set_default_response(
RET_YES);
2225 bool bEditExisting = xQueryBox->run() ==
RET_YES;
2232 if (rCondFormats.
size() == 1)
2234 pCondFormat = pList->
GetFormat(rCondFormats[0]);
2235 assert(pCondFormat);
2237 bCondFormatDlg =
true;
2249 pCondFormat = pList->
GetFormat(rCondFormats[0]);
2250 assert(pCondFormat);
2251 bCondFormatDlg =
true;
2258 case SID_OPENDLG_CONDFRMT:
2259 case SID_OPENDLG_CURRENTCONDFRMT:
2262 case SID_OPENDLG_COLORSCALE:
2265 case SID_OPENDLG_DATABAR:
2268 case SID_OPENDLG_ICONSET:
2271 case SID_OPENDLG_CONDDATE:
2280 if(bCondFormatDlg || !bContainsCondFormat)
2288 sal_uInt16
nId = ScCondFormatDlgWrapper::GetChildWindowId();
2297 case SID_DEFINE_COLROWNAMERANGES:
2300 sal_uInt16
nId = ScColRowNameRangesDlgWrapper::GetChildWindowId();
2309 case SID_UPDATECHART:
2317 if( pReqArgs->
HasItem( SID_UPDATECHART, &pItem ) )
2323 if( ! rReq.
IsAPI() )
2336 pReqArgs->
Get( SID_TABOP ));
2340 rReq.
Done( *pReqArgs );
2352 rReq.
Done( *pReqArgs );
2356 case FID_INSERT_NAME:
2361 switch( pDlg->Execute() )
2374 std::vector<OUString> aNames = pDlg->GetSelectedNames();
2375 if (!aNames.empty())
2378 for (
const auto& rName : aNames)
2391 case SID_RANGE_NOTETEXT:
2403 case SID_INSERT_POSTIT:
2404 case SID_EDIT_POSTIT:
2407 if ( pReqArgs && (pTextItem = pReqArgs->
GetItemIfSet( SID_ATTR_POSTIT_TEXT )) )
2412 aCellId = pCellId->GetValue();
2417 if (!aCellId.isEmpty())
2423 pTabViewShell->
ReplaceNote( aPos, pTextItem->GetValue(),
2424 pAuthorItem ? &pAuthorItem->GetValue() :
nullptr,
2425 pDateItem ? &pDateItem->GetValue() :
nullptr );
2435 case FID_NOTE_VISIBLE:
2443 if ( pReqArgs && (pReqArgs->
GetItemState( FID_NOTE_VISIBLE,
true, &pItem ) == SfxItemState::SET) )
2446 bShow = !pNote->IsCaptionShown();
2464 bool bShowNote = nSlot == FID_SHOW_NOTE;
2486 OUString aUndo =
ScResId( bShowNote ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE );
2492 std::vector<sc::NoteEntry> aNotes;
2527 case FID_SHOW_ALL_NOTES:
2528 case FID_HIDE_ALL_NOTES:
2530 bool bShowNote = nSlot == FID_SHOW_ALL_NOTES;
2534 std::vector<sc::NoteEntry> aNotes;
2536 OUString aUndo =
ScResId( bShowNote ? STR_UNDO_SHOWALLNOTES : STR_UNDO_HIDEALLNOTES );
2554 case SID_TOGGLE_NOTES:
2560 std::vector<sc::NoteEntry> aNotes;
2569 OUString aUndo =
ScResId( bShowNote ? STR_UNDO_SHOWALLNOTES : STR_UNDO_HIDEALLNOTES );
2572 for(
const auto& rNote : aNotes)
2588 case SID_DELETE_NOTE:
2592 if ( pReqArgs && (pIdItem = pReqArgs->
GetItemIfSet( SID_ATTR_POSTIT_ID )) )
2594 const OUString& aCellId = pIdItem->GetValue();
2595 if (!aCellId.isEmpty())
2606 case FID_DELETE_ALL_NOTES:
2625 if( pReqArgs !=
nullptr )
2627 OUString aChars, aFontName;
2643 if ( !aChars.isEmpty() )
2648 if ( !aFontName.isEmpty() )
2651 if( ! rReq.
IsAPI() )
2674 case SID_SELECT_SCENARIO:
2689 case SID_HYPERLINK_SETLINK:
2693 if( pReqArgs->
HasItem( SID_HYPERLINK_SETLINK, &pItem ) )
2696 const OUString& rName = pHyper->
GetName();
2697 const OUString& rURL = pHyper->
GetURL();
2709 case SID_OPENDLG_CONDFRMT_MANAGER:
2710 case SID_OPENDLG_CURRENTCONDFRMT_MANAGER:
2719 pTabViewShell->
ErrorMessage( STR_ERR_CONDFORMAT_PROTECTED );
2729 if (itemsRange.begin() != itemsRange.end())
2742 pDlg->SetModified();
2744 pDlg->StartExecuteAsync([
this, pDlg, &rData, pTabViewShell, pDlgItem, aPos](sal_Int32 nRet){
2745 std::unique_ptr<ScConditionalFormatList> pCondFormatList = pDlg->GetConditionalFormatList();
2746 if(nRet ==
RET_OK && pDlg->CondFormatsChanged())
2748 rData.GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList.release(), aPos.Tab());
2754 pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
2755 std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()), -1, true));
2757 GetViewData().GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
2766 std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()),
nIndex,
true));
2772 pCondFormatList.reset();
2777 pDlg->disposeOnce();
2782 case SID_EXTERNAL_SOURCE:
2786 if ( pFile && pSource )
2792 sal_Int32 nRefreshDelaySeconds=0;
2795 aSource = pSource->GetValue();
2804 nRefreshDelaySeconds = pRefresh->
GetValue();
2812 pImpl->m_pLinkedDlg.disposeAndClear();
2813 pImpl->m_pLinkedDlg =
2815 delete pImpl->m_pRequest;
2817 OUString sFile, sFilter, sOptions, sSource;
2818 sal_Int32 nRefreshDelaySeconds = 0;
2821 sFile =
pImpl->m_pLinkedDlg->GetURL();
2822 sFilter =
pImpl->m_pLinkedDlg->GetFilter();
2823 sOptions =
pImpl->m_pLinkedDlg->GetOptions();
2824 sSource =
pImpl->m_pLinkedDlg->GetSource();
2825 nRefreshDelaySeconds =
pImpl->m_pLinkedDlg->GetRefreshDelaySeconds();
2826 if ( !sFile.isEmpty() )
2828 if ( !sFilter.isEmpty() )
2830 if ( !sOptions.isEmpty() )
2832 if ( !sSource.isEmpty() )
2834 if ( nRefreshDelaySeconds )
2846 const OUString sFunction = pArgs ?
2851 if (sFunction ==
"average")
2853 else if (sFunction ==
"count")
2855 else if (sFunction ==
"min")
2857 if (sFunction ==
"max")
2860 bool bSubTotal =
false;
2861 bool bRangeFinder =
false;
2862 const OUString aFormula = pTabViewShell->
DoAutoSum( bRangeFinder, bSubTotal , eFunction );
2863 if ( !aFormula.isEmpty() )
2865 const sal_Int32 nPar = aFormula.indexOf(
'(' );
2866 const sal_Int32 nLen = aFormula.getLength();
2869 if ( pHdl && nPar != -1 )
2898 case SID_SELECT_UNPROTECTED_CELLS:
2912 case SID_SELECT_VISIBLE_ROWS:
2926 bool bChanged =
false;
2927 for (
const SCTAB& nTab : rMark)
2929 for (
SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
2931 SCROW nLastRow = nRow;
2932 if (rDoc.
RowHidden(nRow, nTab,
nullptr, &nLastRow))
2935 ScRange(nStartCol, nRow, nTab, nEndCol, nLastRow, nTab),
false);
2951 case SID_SELECT_VISIBLE_COLUMNS:
2965 bool bChanged =
false;
2966 for (
const SCTAB& nTab : rMark)
2968 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol)
2970 SCCOL nLastCol = nCol;
2971 if (rDoc.
ColHidden(nCol, nTab,
nullptr, &nLastCol))
2974 ScRange(nCol, nStartRow, nTab, nLastCol, nEndRow, nTab),
false);
2990 case SID_CURRENT_FORMULA_RANGE:
3009 if (param3 && param4 && pInputHdl)
3014 if (param1 && param2)
3030 OSL_FAIL(
"incorrect slot in ExecuteEdit");
3038 if (
nType != TransliterationFlags::NONE )
3047 if( rReq.
GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
3052 const OUString& _rFile,
const OUString& _rFilter,
const OUString& _rOptions,
3053 const OUString& _rSource, sal_Int32 _nRefreshDelaySeconds,
SfxRequest& _rRequest )
3055 if ( !_rFile.isEmpty() && !_rSource.isEmpty() )
3072 aLinkRange, _nRefreshDelaySeconds, bMove,
false );
3081bool isDPSourceValid(
const ScDPObject& rDPObj)
3103void RunPivotLayoutDialog(
ScModule* pScMod,
3105 std::unique_ptr<ScDPObject>& pNewDPObject)
3107 bool bHadNewDPObject = pNewDPObject !=
nullptr;
3109 if ( bHadNewDPObject )
3113 sal_uInt16
nId = ScPivotLayoutWrapper::GetChildWindowId();
3120void SetupRangeForPivotTableDialog(
const ScRange& rRange,
3124 std::unique_ptr<ScDPObject>& pNewDPObject)
3127 aShtDesc.SetSourceRange(rRange);
3128 pSrcErrorId = aShtDesc.CheckSourceRange();
3132 pNewDPObject->SetSheetDesc( aShtDesc );
3142void ErrorOrRunPivotLayoutDialog(
TranslateId pSrcErrorId,
3146 std::unique_ptr<ScDPObject>& pNewDPObject)
3152 VclMessageType::Info, VclButtonsType::Ok,
3159 pNewDPObject->SetOutRange( rDestPos );
3161 RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject);
3179 std::unique_ptr<ScDPObject> pNewDPObject;
3181 if (isDPSourceValid(*pDPObj))
3184 RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject);
3213 for (; itr != itrEnd; ++itr)
3214 pTypeDlg->AppendNamedRange(itr->second->GetName());
3217 pTypeDlg->StartExecuteAsync([
this, pTypeDlg, pTabViewShell,
3218 pScMod, pFact, &rDoc, &rMark, aDestPos](
int nResult)
mutable {
3222 if ( pTypeDlg->IsExternal() )
3224 std::vector<OUString> aSources = ScDPObject::GetRegisteredSources();
3225 VclPtr<AbstractScDataPilotServiceDlg> pServDlg(
3226 pFact->CreateScDataPilotServiceDlg(
3227 pTabViewShell->GetFrameWeld(), aSources));
3229 pServDlg->StartExecuteAsync([pServDlg, pScMod, pTabViewShell,
3230 aDestPos, &rDoc](int nResult2) mutable {
3231 if ( nResult2 == RET_OK )
3233 ScDPServiceDesc aServDesc(
3234 pServDlg->GetServiceName(),
3235 pServDlg->GetParSource(),
3236 pServDlg->GetParName(),
3237 pServDlg->GetParUser(),
3238 pServDlg->GetParPass() );
3239 std::unique_ptr<ScDPObject> pNewDPObject(new ScDPObject(&rDoc));
3240 pNewDPObject->SetServiceData( aServDesc );
3241 pNewDPObject->SetOutRange(aDestPos);
3243 RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject);
3246 pServDlg->disposeOnce();
3249 else if ( pTypeDlg->IsDatabase() )
3251 assert(pFact &&
"ScAbstractFactory create fail!");
3254 assert(pDataDlg &&
"Dialog create fail!");
3256 pDataDlg->StartExecuteAsync([pDataDlg, pScMod, pTabViewShell,
3257 aDestPos, &rDoc](
int nResult2)
mutable {
3258 if ( nResult2 ==
RET_OK )
3261 pDataDlg->GetValues( aImpDesc );
3262 std::unique_ptr<ScDPObject> pNewDPObject(
new ScDPObject(&rDoc));
3263 pNewDPObject->SetImportDesc( aImpDesc );
3264 pNewDPObject->SetOutRange(aDestPos);
3266 RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject);
3269 pDataDlg->disposeOnce();
3276 if (pTypeDlg->IsNamedRange())
3278 std::unique_ptr<ScDPObject> pNewDPObject;
3279 OUString
aName = pTypeDlg->GetSelectedNamedRange();
3286 pNewDPObject->SetSheetDesc(aShtDesc);
3289 ErrorOrRunPivotLayoutDialog(pSrcErrorId, aDestPos, pScMod, pTabViewShell, pNewDPObject);
3317 VclMessageType::Question, VclButtonsType::YesNo,
3318 ScResId(STR_DATAPILOT_SUBTOTAL)));
3319 xQueryBox->set_default_response(
RET_YES);
3320 xQueryBox->runAsync(xQueryBox, [aRange, pDoc, pTypeDlg, aDestPos,
3321 pScMod, pTabViewShell, pSrcErrorId] (
int nResult2)
mutable {
3325 std::unique_ptr<ScDPObject> pNewDPObject;
3326 SetupRangeForPivotTableDialog(aRange, aDestPos, pDoc, pSrcErrorId, pNewDPObject);
3327 ErrorOrRunPivotLayoutDialog(pSrcErrorId, aDestPos, pScMod, pTabViewShell, pNewDPObject);
3330 pTypeDlg->disposeOnce();
3334 std::unique_ptr<ScDPObject> pNewDPObject;
3335 SetupRangeForPivotTableDialog(aRange, aDestPos, pDoc, pSrcErrorId, pNewDPObject);
3336 ErrorOrRunPivotLayoutDialog(pSrcErrorId, aDestPos, pScMod, pTabViewShell, pNewDPObject);
3342 pTypeDlg->disposeOnce();
3355 sal_uInt16
nId = ScXMLSourceDlgWrapper::GetChildWindowId();
3368 GetSubTotalData() );
3391 pTabViewShell->
MarkRange(aDataRange,
false);
3407 pDlg->SetCurPageId(
"1stgroup");
3409 short bResult = pDlg->Execute();
3417 pOutSet = pDlg->GetOutputItemSet();
3428 &aSubTotalParam ) );
3432 rReq.
Done( *pOutSet );
3444 if (aCurPos.
Row() > 0)
3468 m_pRequest( nullptr ) {}
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 ...
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static sal_uInt16 GetChildWindowId()
sal_Int32 GetValue() const
sal_uInt16 GetValue() const
sal_uInt32 GetValue() const
const OUString & GetValue() const
void AddDays(sal_Int32 nAddDays)
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
sal_uInt16 GetMonth() const
ESelection GetSelection() const
void SetSelection(const ESelection &rNewSel)
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
TransliterationFlags getNextMode()
static void SetError(ErrCode)
virtual VclPtr< AbstractScDataPilotDatabaseDlg > CreateScDataPilotDatabaseDlg(weld::Window *pParent)=0
virtual VclPtr< AbstractScNamePasteDlg > CreateScNamePasteDlg(weld::Window *pParent, ScDocShell *pShell)=0
virtual VclPtr< AbstractScFillSeriesDlg > CreateScFillSeriesDlg(weld::Window *pParent, ScDocument &rDocument, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, const OUString &aStartStr, double fStep, double fMax, SCSIZE nSelectHeight, SCSIZE nSelectWidth, sal_uInt16 nPossDir)=0
virtual VclPtr< AbstractScDPDateGroupDlg > CreateScDPDateGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo, sal_Int32 nDatePart, const Date &rNullDate)=0
virtual VclPtr< AbstractScDataPilotSourceTypeDlg > CreateScDataPilotSourceTypeDlg(weld::Window *pParent, bool bEnableExternal)=0
virtual VclPtr< AbstractScInsertCellDlg > CreateScInsertCellDlg(weld::Window *pParent, bool bDisallowCellMove)=0
virtual VclPtr< AbstractScNameCreateDlg > CreateScNameCreateDlg(weld::Window *pParent, CreateNameFlags nFlags)=0
virtual VclPtr< AbstractScDPShowDetailDlg > CreateScDPShowDetailDlg(weld::Window *pParent, ScDPObject &rDPObj, css::sheet::DataPilotFieldOrientation nOrient)=0
virtual VclPtr< AbstractScInsertContentsDlg > CreateScInsertContentsDlg(weld::Window *pParent, const OUString *pStrTitle=nullptr)=0
virtual VclPtr< AbstractScDPNumGroupDlg > CreateScDPNumGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo)=0
virtual VclPtr< AbstractScGroupDlg > CreateAbstractScGroupDlg(weld::Window *pParent, bool bUnGroup=false)=0
virtual VclPtr< AbstractScDeleteCellDlg > CreateScDeleteCellDlg(weld::Window *pParent, bool bDisallowCellMove)=0
virtual VclPtr< AbstractScLinkedAreaDlg > CreateScLinkedAreaDlg(weld::Widget *pParent)=0
virtual VclPtr< AbstractScDeleteContentsDlg > CreateScDeleteContentsDlg(weld::Window *pParent)=0
virtual VclPtr< SfxAbstractTabDialog > CreateScSubTotalDlg(weld::Window *pParent, const SfxItemSet &rArgSet)=0
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
virtual VclPtr< AbstractScImportAsciiDlg > CreateScImportAsciiDlg(weld::Window *pParent, const OUString &aDatName, SvStream *pInStream, ScImportAsciiCall eCall)=0
virtual VclPtr< AbstractScCondFormatManagerDlg > CreateScCondFormatMgrDlg(weld::Window *pParent, ScDocument &rDoc, const ScConditionalFormatList *pFormatList)=0
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
void IncRow(SCROW nDelta=1)
void GetPossibleClipboardFormats(SvxClipboardFormatItem &rFormats)
bool HasClipboardFormat(SotClipboardFormatId nFormatId)
void Execute(SfxRequest &)
std::unique_ptr< CellShell_Impl > pImpl
void ExecuteRotateTrans(const SfxRequest &rReq)
RotateTransliteration m_aRotateCase
void ExecuteExternalSource(const OUString &_rFile, const OUString &_rFilter, const OUString &_rOptions, const OUString &_rSource, sal_Int32 _nRefreshDelaySeconds, SfxRequest &_rRequest)
void ExecuteEdit(SfxRequest &rReq)
void ExecuteFillSingleEdit()
void ExecuteTrans(SfxRequest &rReq)
void ExecuteDataPilotDialog()
void ExecuteSubtotals(SfxRequest &rReq)
void ExecuteXMLSourceDialog()
const ScConsolidateParam & GetData() const
Parameters for conversion.
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
ScDBData * GetAnonymousDBData()
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
void RemoveOutline(bool bColumns, bool bRecord=true)
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
bool HasSelectionForDrillDown(css::sheet::DataPilotFieldOrientation &rOrientation)
bool HasSelectionForDateGroup(ScDPNumGroupInfo &rOldInfo, sal_Int32 &rParts)
void NumGroupDataPilot(const ScDPNumGroupInfo &rInfo)
void MakeOutline(bool bColumns, bool bRecord=true)
void TestRemoveOutline(bool &rCol, bool &rRow)
void DateGroupDataPilot(const ScDPNumGroupInfo &rInfo, sal_Int32 nParts)
bool HasSelectionForNumGroup(ScDPNumGroupInfo &rOldInfo)
void Consolidate(const ScConsolidateParam &rParam)
void ShowMarkedOutlines(bool bRecord=true)
void SetDataPilotDetails(bool bShow, const OUString *pNewDimensionName=nullptr)
void UpdateCharts(bool bAllCharts)
void ShowDataPilotSourceData(ScDPObject &rDPObj, const css::uno::Sequence< css::sheet::DataPilotFieldFilter > &rFilters)
void HideMarkedOutlines(bool bRecord=true)
This class represents the cached data part of the datapilot cache table implementation.
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
bool IsServiceData() const
bool GetDataFieldPositionData(const ScAddress &rPos, css::uno::Sequence< css::sheet::DataPilotFieldFilter > &rFilters)
static bool HasRegisteredSources()
ScDPSaveData * GetSaveData() const
bool IsImportData() const
const ScImportSourceDesc * GetImportSourceDesc() const
const ScDPDimensionSaveData * GetExistingDimensionData() const
SC_DLLPUBLIC bool ShowNote(const ScAddress &rPos, bool bShow)
void ReplaceConditionalFormat(sal_uLong nOldIndex, std::unique_ptr< ScConditionalFormat > pFormat, SCTAB nTab, const ScRangeList &rRanges)
SC_DLLPUBLIC bool DeleteContents(const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
void InsertAreaLink(const OUString &rFile, const OUString &rFilter, const OUString &rOptions, const OUString &rSource, const ScRange &rDestRange, sal_Int32 nRefreshDelaySeconds, bool bFitBlock, bool bApi)
SC_DLLPUBLIC bool UngroupSparklines(ScRange const &rRange)
SC_DLLPUBLIC bool DeleteSparklineGroup(std::shared_ptr< sc::SparklineGroup > const &pSparklineGroup, SCTAB nTab)
SC_DLLPUBLIC bool GroupSparklines(ScRange const &rRange, std::shared_ptr< sc::SparklineGroup > const &rpGroup)
const ScDocument & GetDocument() const
virtual SfxUndoManager * GetUndoManager() override
ScSheetLimits & GetSheetLimits() const
SC_DLLPUBLIC std::shared_ptr< sc::Sparkline > GetSparkline(ScAddress const &rPosition)
Returns sparkline at the address if it exists.
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
CommentCaptionState GetAllNoteCaptionsState(const ScRangeList &rRanges)
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
void GetUnprotectedCells(ScRangeList &rRange, SCTAB nTab) const
bool ShrinkToDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow) const
Shrink a range to only include data area.
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
void SetConsolidateDlgData(std::unique_ptr< ScConsolidateParam > pData)
SC_DLLPUBLIC void GetAllNoteEntries(std::vector< sc::NoteEntry > &rNotes) const
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) 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
SC_DLLPUBLIC OUString GetInputString(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bForceSystemLocale=false) const
SC_DLLPUBLIC ScDPObject * GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const
void GetClipArea(SCCOL &nClipX, SCROW &nClipY, bool bIncludeFiltered)
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
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
ScChangeTrack * GetChangeTrack() const
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
void GetNotesInRange(const ScRangeList &rRange, std::vector< sc::NoteEntry > &rNotes) const
bool HasSubTotalCells(const ScRange &rRange)
bool IsClipboardSource() const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
void GetClipStart(SCCOL &nClipX, SCROW &nClipY)
static ScDrawTransferObj * GetOwnClipboard(const css::uno::Reference< css::datatransfer::XTransferable2 > &)
TranslateId GetMessageId() const
static SC_DLLPUBLIC LanguageType eLnge
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMultiMarkArea() const
const ScRange & GetMarkArea() const
bool IsMultiMarked() const
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
bool HasAnyMultiMarks() const
bool GetTableSelect(SCTAB nTab) const
void SetMultiMarkArea(const ScRange &rRange, bool bMark=true, bool bSetupMulti=false)
void SetMarkArea(const ScRange &rRange)
const MarkedTabsType & GetSelectedTabs() const
void MarkFromRangeList(const ScRangeList &rList, bool bReset)
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
SC_DLLPUBLIC void SetRefDialog(sal_uInt16 nId, bool bVis, SfxViewFrame *pViewFrm=nullptr)
Reference dialogs.
bool InputKeyEvent(const KeyEvent &rKEvt, bool bStartEdit=false)
void SetInputMode(ScInputMode eMode, const OUString *pInitText=nullptr)
void ActivateInputWindow(const OUString *pStr=nullptr, bool bMatrix=false)
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
static void fillFontOnly(vcl::Font &rFont, const SfxItemSet &rItemSet, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE)
Static helper function to fill a font object from the passed item set.
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Additional class containing cell annotation data.
const ScRange * Find(const ScAddress &) const
void push_back(const ScRange &rRange)
SC_DLLPUBLIC const_iterator end() const
DataType::const_iterator const_iterator
SC_DLLPUBLIC const_iterator begin() const
bool Intersects(const ScRange &rRange) const
This class contains authoritative information on the internal reference used as the data source for d...
TranslateId CheckSourceRange() const
Check the sanity of the data source range.
SC_DLLPUBLIC void SetRangeName(const OUString &rName)
const ScSolveParam & GetData() const
const ScTabOpParam & GetData() const
virtual void ShowCursor(bool bOn) override
static css::uno::Reference< css::datatransfer::XTransferable2 > GetClipData(vcl::Window *pWin)
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
void SetDialogDPObject(std::unique_ptr< ScDPObject > pObj)
OUString DoAutoSum(bool &rRangeFinder, bool &rSubTotal, const OpCode eCode)
void InsertURL(const OUString &rName, const OUString &rURL, const OUString &rTarget, sal_uInt16 nMode)
void MarkDataArea(bool bIncludeCursor=true)
void ErrorMessage(TranslateId pGlobStrId)
void SelectionChanged(bool bFromPaste=false)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
ScViewData & GetViewData()
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
void UpdateCopySourceOverlay()
SC_DLLPUBLIC void CellContentChanged()
void SetMarkData(const ScMarkData &rNew)
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
OUString CreateString(sc::TokenStringContext &rCxt, const ScAddress &rPos) const
Create a string representation of formula token array without modifying the internal state of the tok...
ScDocument * GetDocument() const
static SC_DLLPUBLIC ScTransferObj * GetOwnClipboard(const css::uno::Reference< css::datatransfer::XTransferable2 > &)
void GetMultiArea(ScRangeListRef &rRange) const
SfxDispatcher & GetDispatcher()
ScDocFunc & GetDocFunc() const
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScGridWindow * GetActiveWin()
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
ScDBFunc * GetView() const
void GetFillData(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow)
SCTAB GetRefStartZ() const
void SetPasteMode(ScPasteFlags nFlags)
bool IsMultiMarked() const
ScAddress GetCurPos() const
void SetRefStart(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
void TabOp(const ScTabOpParam &rParam, bool bRecord=true)
bool SelectionEditable(bool *pOnlyNotBecauseOfMatrix=nullptr)
void DeleteCells(DelCellCmd eCmd)
void FillTab(InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bAsLink)
void ReplaceNote(const ScAddress &rPos, const OUString &rNoteText, const OUString *pAuthor, const OUString *pDate)
SC_DLLPUBLIC void FillSimple(FillDir eDir)
void EnterData(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const EditTextObject *pData=nullptr, bool bMatrixExpand=false)
SC_DLLPUBLIC void DeletePageBreak(bool bColumn, bool bRecord=true, const ScAddress *pPos=nullptr, bool bSetModified=true)
void FillSeries(FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, double fStart, double fStep, double fMax)
void TransliterateText(TransliterationFlags nType)
bool InsertCells(InsCellCmd eCmd, bool bRecord=true, bool bPartOfPaste=false)
SC_DLLPUBLIC void CutToClip()
void DetectiveMarkInvalid()
SC_DLLPUBLIC void InsertPageBreak(bool bColumn, bool bRecord=true, const ScAddress *pPos=nullptr, bool bSetModified=true)
SvtScriptType GetSelectionScriptType()
void ShowNote(bool bShow)
SC_DLLPUBLIC void FillAuto(FillDir eDir, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uLong nCount)
SC_DLLPUBLIC const ScPatternAttr * GetSelectionPattern()
void DeleteContents(InsertDeleteFlags nFlags)
void Solve(const ScSolveParam &rParam)
SC_DLLPUBLIC void PasteFromSystem()
void CreateNames(CreateNameFlags nFlags)
void InsertCurrentTime(SvNumFormatType nCellFmt, const OUString &rUndoStr)
Insert date or time into current cell.
void DoHangulHanjaConversion()
void InsertSpecialChar(const OUString &rStr, const vcl::Font &rFont)
void SetNoteText(const ScAddress &rPos, const OUString &rNoteText)
void DoSheetConversion(const ScConversionParam &rParam)
Generic implementation of sheet conversion functions.
bool InsertName(const OUString &rName, const OUString &rSymbol, const OUString &rType)
SC_DLLPUBLIC bool CopyToClip(ScDocument *pClipDoc, bool bCut, bool bApi=false, bool bIncludeObjects=false, bool bStopEdit=true)
CreateNameFlags GetCreateNameFlags()
SC_DLLPUBLIC bool PasteFromClip(InsertDeleteFlags nFlags, ScDocument *pClipDoc, ScPasteFunc nFunction=ScPasteFunc::NONE, bool bSkipEmptyCells=false, bool bTranspose=false, bool bAsLink=false, InsCellCmd eMoveMode=INS_NONE, InsertDeleteFlags nUndoExtraFlags=InsertDeleteFlags::NONE, bool bAllowDialogs=false)
void ChangeIndent(bool bIncrement)
void ConvertFormulaToValue()
void UseScenario(const OUString &rName)
static TransliterationFlags GetTransliterationType(sal_uInt16 nSlotID)
void disposeAndReset(reference_type *pBody)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
sal_Int16 GetValue() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
void Remove(const SfxPoolItem &)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
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 * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void SetSlot(sal_uInt16 nNewSlot)
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
virtual SfxInterface * GetInterface() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxDispatcher * GetDispatcher() const
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
weld::Window * GetFrameWeld() const
ViewShellId GetViewShellId() const override
SfxViewFrame & GetViewFrame() const
virtual VclPtr< SfxAbstractDialog > CreateCharMapDialog(weld::Window *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
static SvxAbstractDialogFactory * Create()
SvxLinkInsertMode GetInsertMode() const
const OUString & GetName() const
const OUString & GetURL() const
const OUString & GetTargetFrame() const
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
weld::Window * GetFrameWeld() const
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
@ SPARKLINES
Sheet / outlining (grouping) information.
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ STRING
Dates, times, datetime values.
@ DATETIME
Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
#define LANGUAGE_CHINESE_TRADITIONAL
#define LANGUAGE_CHINESE_SIMPLIFIED
Sequence< sal_Int8 > aSeq
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
SC_DLLPUBLIC void PasteFromClipboard(ScViewData &rViewData, ScTabViewShell *pTabViewShell, bool bShowDialog)
bool isTiledAnnotations()
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
sal_uInt32 toUInt32(std::u16string_view str, sal_Int16 radix=10)
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetModuleIdentifier(const Reference< frame::XFrame > &rxFrame)
OUString GetTooltipLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
#define ERRCODE_BASIC_BAD_PARAMETER
OUString ScResId(TranslateId aId)
#define SCITEM_CONDFORMATDLGDATA
#define SCITEM_CONSOLIDATEDATA
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
@ SC_CONVERSION_CHINESE_TRANSL
Hangul-Hanja converter.
const ScDPCache * CreateCache(const ScDPDimensionSaveData *pDimData) const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
ScFormulaCell * getFormula() const
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
bool bIncludePattern
sort formats
bool bReplace
replace existing results
Context for creating string from an array of formula tokens, used in ScTokenArray::CreateString().
Reference< XFrame > xFrame
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
std::unique_ptr< char[]> aBuffer