29#include <editeng/editeng.hxx>
50#include <com/sun/star/awt/XBitmap.hpp>
51#include <com/sun/star/util/CellProtection.hpp>
52#include <com/sun/star/table/CellHoriJustify.hpp>
53#include <com/sun/star/table/CellOrientation.hpp>
54#include <com/sun/star/table/ShadowFormat.hpp>
55#include <com/sun/star/table/TableBorder.hpp>
56#include <com/sun/star/table/TableBorder2.hpp>
57#include <com/sun/star/sheet/CellFlags.hpp>
58#include <com/sun/star/sheet/FormulaResult.hpp>
59#include <com/sun/star/beans/PropertyAttribute.hpp>
60#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
61#include <com/sun/star/lang/Locale.hpp>
62#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
63#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp>
64#include <com/sun/star/text/WritingMode2.hpp>
65#include <com/sun/star/text/textfield/Type.hpp>
66#include <com/sun/star/sheet/XConditionalFormats.hpp>
100#include <stlsheet.hxx>
115#include <globstr.hrc>
117#include <unonames.hxx>
129#include <tokenarray.hxx>
250 {
u"", 0, css::uno::Type(), 0, 0 }
253 return &aCellsPropertySet;
361 {
u"", 0, css::uno::Type(), 0, 0 }
364 return &aRangePropertySet;
478 {
u"", 0, css::uno::Type(), 0, 0 }
481 return &aCellPropertySet;
593 {
u"", 0, css::uno::Type(), 0, 0 }
596 return &aColumnPropertySet;
706 {
u"", 0, css::uno::Type(), 0, 0 }
709 return &aRowPropertySet;
831 {
u"", 0, css::uno::Type(), 0, 0 }
834 return &aSheetPropertySet;
847 {
u"", 0, css::uno::Type(), 0, 0 }
849 return aEditPropertyMap_Impl;
854 return &aEditPropertySet;
890 uno::Reference<beans::XPropertySetInfo> xInfo(rSource.getPropertySetInfo());
893 const uno::Sequence<beans::Property>
aSeq(xInfo->getProperties());
894 for (
const beans::Property& rProp :
aSeq)
896 OUString
aName(rProp.Name);
897 rDest.setPropertyValue(
aName, rSource.getPropertyValue(
aName ) );
905 throw std::out_of_range(
"empty range");
906 const ScRange & rFirst = rRanges[0];
912 if ( rRanges.
size() == 1 )
914 const ScRange & rRange = rRanges[0];
923template<
typename BorderLineType>
924const ::editeng::SvxBorderLine* lcl_getBorderLine(
941 return lcl_getBorderLine( rLine, rStruct);
947 return lcl_getBorderLine( rLine, rStruct);
951template<
typename TableBorderType>
962 rInner.
SetValid( SvxBoxInfoItemValidFlags::TOP, rBorder.IsTopLineValid );
963 rInner.
SetValid( SvxBoxInfoItemValidFlags::BOTTOM, rBorder.IsBottomLineValid );
964 rInner.
SetValid( SvxBoxInfoItemValidFlags::LEFT, rBorder.IsLeftLineValid );
965 rInner.
SetValid( SvxBoxInfoItemValidFlags::RIGHT, rBorder.IsRightLineValid );
966 rInner.
SetValid( SvxBoxInfoItemValidFlags::HORI, rBorder.IsHorizontalLineValid );
967 rInner.
SetValid( SvxBoxInfoItemValidFlags::VERT, rBorder.IsVerticalLineValid );
968 rInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE, rBorder.IsDistanceValid );
975 lcl_fillBoxItems( rOuter, rInner, rBorder);
980 lcl_fillBoxItems( rOuter, rInner, rBorder);
995template<
typename TableBorderItem>
997 bool bInvalidateHorVerDist )
1007 rBorder.IsTopLineValid = rInner.
IsValid(SvxBoxInfoItemValidFlags::TOP);
1008 rBorder.IsBottomLineValid = rInner.
IsValid(SvxBoxInfoItemValidFlags::BOTTOM);
1009 rBorder.IsLeftLineValid = rInner.
IsValid(SvxBoxInfoItemValidFlags::LEFT);
1010 rBorder.IsRightLineValid = rInner.
IsValid(SvxBoxInfoItemValidFlags::RIGHT);
1011 rBorder.IsHorizontalLineValid = !bInvalidateHorVerDist && rInner.
IsValid(SvxBoxInfoItemValidFlags::HORI);
1012 rBorder.IsVerticalLineValid = !bInvalidateHorVerDist && rInner.
IsValid(SvxBoxInfoItemValidFlags::VERT);
1013 rBorder.IsDistanceValid = !bInvalidateHorVerDist && rInner.
IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
1020 table::TableBorder aBorder;
1021 lcl_fillTableBorder( aBorder, rOuter, rInner, bInvalidateHorVerDist);
1028 table::TableBorder2 aBorder;
1029 lcl_fillTableBorder( aBorder, rOuter, rInner, bInvalidateHorVerDist);
1046 ScRange const & rRange = rRanges[
i ];
1052 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1054 pUndoDoc->AddUndoTab( nTab, nTab );
1069 std::make_unique<ScUndoBorder>( pDocShell, rRanges, std::move(pUndoDoc), rOuter, rInner ) );
1082 const uno::Sequence< uno::Sequence<uno::Any> >& aData )
1093 if ( !rDoc.
IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
1099 sal_Int32 nCols = 0;
1100 sal_Int32 nRows =
aData.getLength();
1102 nCols =
aData[0].getLength();
1104 if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
1114 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1120 bool bError =
false;
1121 SCROW nDocRow = nStartRow;
1122 for (
const uno::Sequence<uno::Any>& rColSeq :
aData)
1124 if ( rColSeq.getLength() == nCols )
1126 SCCOL nDocCol = nStartCol;
1127 for (
const uno::Any& rElement : rColSeq)
1131 switch( rElement.getValueTypeClass() )
1133 case uno::TypeClass_VOID:
1136 rDoc.
SetError( nDocCol, nDocRow, nTab, FormulaError::NotAvailable );
1142 case uno::TypeClass_BYTE:
1143 case uno::TypeClass_SHORT:
1144 case uno::TypeClass_UNSIGNED_SHORT:
1145 case uno::TypeClass_LONG:
1146 case uno::TypeClass_UNSIGNED_LONG:
1147 case uno::TypeClass_FLOAT:
1148 case uno::TypeClass_DOUBLE:
1156 case uno::TypeClass_STRING:
1160 if ( !aUStr.isEmpty() )
1180 case uno::TypeClass_SEQUENCE:
1182 uno::Sequence< sheet::FormulaToken > aTokens;
1183 if ( rElement >>= aTokens )
1213 std::make_unique<ScUndoPaste>(
1214 &rDocShell,
ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab),
1227 const uno::Sequence< uno::Sequence<OUString> >& aData,
1238 if ( !rDoc.
IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
1244 sal_Int32 nCols = 0;
1245 sal_Int32 nRows =
aData.getLength();
1247 nCols =
aData[0].getLength();
1249 if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
1259 pUndoDoc->InitUndo( rDoc, nTab, nTab );
1265 bool bError =
false;
1266 SCROW nDocRow = nStartRow;
1267 for (
const uno::Sequence<OUString>& rColSeq :
aData)
1269 if ( rColSeq.getLength() == nCols )
1271 SCCOL nDocCol = nStartCol;
1272 for (
const OUString& aText : rColSeq)
1274 ScAddress aPos( nDocCol, nDocRow, nTab );
1310 std::make_unique<ScUndoPaste>( &rDocShell,
1311 ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), aDestMark,
1365 OUString aTempString = aVal;
1366 bool bIsNumberFormat(pFormatter->
IsNumberFormat(aTempString, nNumFmt, fDummy));
1367 if ( bIsNumberFormat )
1368 aTempString =
"'" + aTempString;
1369 else if ( aTempString.startsWith(
"'") )
1373 if ( bEnglish || ( pFormatter->
GetType(nNumFmt) != SvNumFormatType::TEXT ) )
1374 aTempString =
"'" + aTempString;
1383 pDocShell( pDocSh ),
1385 bChartColAsHdr( false ),
1386 bChartRowAsHdr( false ),
1387 bCursorOnly( false ),
1388 bGotDataChangedHint( false ),
1389 aValueListeners( 0 )
1405 pDocShell( pDocSh ),
1408 bChartColAsHdr( false ),
1409 bChartRowAsHdr( false ),
1410 bCursorOnly( false ),
1411 bGotDataChangedHint( false ),
1412 aValueListeners( 0 )
1518 if (
nId == SfxHintId::Dying )
1529 lang::EventObject
aEvent;
1531 for (uno::Reference<util::XModifyListener> & xValueListener :
aValueListeners)
1532 xValueListener->disposing(
aEvent );
1540 else if (
nId == SfxHintId::DataChanged )
1555 lang::EventObject
aEvent;
1561 for (
const uno::Reference<util::XModifyListener> & xValueListener :
aValueListeners)
1567 else if (
nId == SfxHintId::ScCalcAll )
1575 else if (
auto pRefHint =
dynamic_cast<const ScUpdateRefHint*
>(&rHint) )
1578 std::unique_ptr<ScRangeList> pUndoRanges;
1583 pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() ) )
1609 if ( pUndoHint->GetObjectId() ==
nObjectId )
1613 aRanges = pUndoHint->GetRanges();
1719 throw uno::RuntimeException();
1748 sal_uInt16& rItemWhich )
1756 rItemWhich = pEntry->
nWID;
1758 switch ( pEntry->
nWID )
1780 beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
1795 if ( eState == SfxItemState::SET )
1796 eRet = beans::PropertyState_DIRECT_VALUE;
1797 else if ( eState == SfxItemState::DEFAULT )
1798 eRet = beans::PropertyState_DEFAULT_VALUE;
1799 else if ( eState == SfxItemState::DONTCARE )
1800 eRet = beans::PropertyState_AMBIGUOUS_VALUE;
1803 OSL_FAIL(
"unknown ItemState");
1810 eRet = beans::PropertyState_DIRECT_VALUE;
1816 eRet = beans::PropertyState_DIRECT_VALUE;
1818 eRet = beans::PropertyState_AMBIGUOUS_VALUE;
1821 eRet = beans::PropertyState_DEFAULT_VALUE;
1830 throw uno::RuntimeException();
1833 sal_uInt16 nItemWhich = 0;
1840 const uno::Sequence<OUString>& aPropertyNames )
1846 uno::Sequence<beans::PropertyState> aRet(aPropertyNames.getLength());
1847 std::transform(aPropertyNames.begin(), aPropertyNames.end(), aRet.getArray(),
1848 [
this, &rPropertyMap](
const auto& rName) -> beans::PropertyState {
1849 sal_uInt16 nItemWhich = 0;
1850 const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( rName );
1851 lcl_GetPropertyWhich( pEntry, nItemWhich );
1852 return GetOnePropertyState(nItemWhich, pEntry);
1864 sal_uInt16 nItemWhich = 0;
1875 sal_uInt16 aWIDs[3];
1876 aWIDs[0] = nItemWhich;
1895 OUString aStyleName(
ScResId( STR_STYLENAME_STANDARD ) );
1922 switch ( pEntry->
nWID )
1938 switch ( pEntry->
nWID )
1946 ScResId(STR_STYLENAME_STANDARD), SfxStyleFamily::Para );
1975 aAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
1989 aAny <<= uno::Reference<beans::XPropertySet>(
2010 static uno::Reference<beans::XPropertySetInfo> aRef(
2017 sal_uInt16& rFirstItemId, sal_uInt16& rSecondItemId )
2019 rFirstItemId = rEntry.
nWID;
2023 switch ( rEntry.
nWID )
2033 sal_Int32 nIntVal = 0;
2034 if ( !(rValue >>= nIntVal) )
2035 throw lang::IllegalArgumentException();
2063 sal_Int16 nIntVal = 0;
2064 if ( !(rValue >>= nIntVal) )
2065 throw lang::IllegalArgumentException();
2073 sal_Int32 nRotVal = 0;
2074 if ( !(rValue >>= nRotVal) )
2075 throw lang::IllegalArgumentException();
2088 table::CellOrientation eOrient;
2089 if( rValue >>= eOrient )
2093 case table::CellOrientation_STANDARD:
2096 case table::CellOrientation_TOPBOTTOM:
2101 case table::CellOrientation_BOTTOMTOP:
2106 case table::CellOrientation_STACKED:
2125 const OUString& aPropertyName,
const uno::Any& aValue )
2130 throw uno::RuntimeException();
2135 throw beans::UnknownPropertyException(aPropertyName);
2162 sal_uInt16 nFirstItem, nSecondItem;
2166 if ( nWhich != nFirstItem && nWhich != nSecondItem )
2173 switch ( pEntry->
nWID )
2226 aStrVal, SfxStyleFamily::Para ));
2232 table::TableBorder aBorder;
2245 table::TableBorder2 aBorder2;
2260 uno::Reference<sheet::XSheetConditionalEntries> xInterface(aValue, uno::UNO_QUERY);
2264 comphelper::getFromUnoTunnel<ScTableConditionalFormat>( xInterface );
2289 auto pNew = std::make_unique<ScConditionalFormat>( 0, &rDoc );
2290 pFormat->
FillFormat( *pNew, rDoc, eGrammar );
2307 uno::Reference<beans::XPropertySet> xInterface(aValue, uno::UNO_QUERY);
2311 comphelper::getFromUnoTunnel<ScTableValidationObj>( xInterface );
2321 std::unique_ptr<ScValidationData> pNewData(
2342 throw uno::RuntimeException();
2347 throw beans::UnknownPropertyException(aPropertyName);
2364 switch ( pEntry->
nWID )
2375 GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
2376 rAny <<= static_cast<sal_Int32>(nOldFormat);
2396 switch ( pEntry->
nWID )
2406 OUString aStyleName;
2409 aStyleName = pStyle->
GetName();
2411 aStyleName, SfxStyleFamily::Para );
2455 rAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
2475 rAny <<= uno::Reference<beans::XPropertySet>(
2496 rAny <<= pPattern->
GetKey();
2503 const uno::Reference<beans::XPropertyChangeListener>& )
2507 throw uno::RuntimeException();
2509 OSL_FAIL(
"not implemented");
2513 const uno::Reference<beans::XPropertyChangeListener>& )
2517 throw uno::RuntimeException();
2519 OSL_FAIL(
"not implemented");
2523 const uno::Reference<beans::XVetoableChangeListener>&)
2525 OSL_FAIL(
"not implemented");
2529 const uno::Reference<beans::XVetoableChangeListener>&)
2531 OSL_FAIL(
"not implemented");
2537 const uno::Sequence< uno::Any >& aValues )
2541 sal_Int32
nCount(aPropertyNames.getLength());
2542 sal_Int32 nValues(aValues.getLength());
2544 throw lang::IllegalArgumentException();
2550 const OUString* pNames = aPropertyNames.getConstArray();
2562 pEntryArray[
i] = pEntry;
2571 catch ( lang::IllegalArgumentException& )
2580 std::unique_ptr<ScPatternAttr> pOldPattern;
2581 std::unique_ptr<ScPatternAttr> pNewPattern;
2595 pOldPattern->GetItemSet().ClearInvalidItems();
2601 sal_uInt16 nFirstItem, nSecondItem;
2606 pNewPattern->GetItemSet().Put( pOldPattern->GetItemSet().Get( nFirstItem ) );
2608 pNewPattern->GetItemSet().Put( pOldPattern->GetItemSet().Get( nSecondItem ) );
2623 const uno::Sequence< OUString >& aPropertyNames )
2629 uno::Sequence<uno::Any> aRet(aPropertyNames.getLength());
2630 uno::Any* pProperties = aRet.getArray();
2631 for(sal_Int32
i = 0;
i < aPropertyNames.getLength();
i++)
2640 const uno::Reference< beans::XPropertiesChangeListener >& )
2642 OSL_FAIL(
"not implemented");
2647 OSL_FAIL(
"not implemented");
2651 const uno::Reference< beans::XPropertiesChangeListener >& )
2653 OSL_FAIL(
"not implemented");
2658 if ( pDocShell && (rHint.GetId() == SfxHintId::ScDataChanged))
2664 bGotDataChangedHint =
true;
2670 const uno::Sequence< uno::Any >& aValues )
2674 sal_Int32
nCount(aPropertyNames.getLength());
2675 sal_Int32 nValues(aValues.getLength());
2677 throw lang::IllegalArgumentException();
2681 uno::Sequence < beans::SetPropertyTolerantFailed > aReturns(
nCount);
2682 beans::SetPropertyTolerantFailed* pReturns = aReturns.getArray();
2685 const OUString* pNames = aPropertyNames.getConstArray();
2697 pMapArray[
i] = pEntry;
2706 catch ( lang::IllegalArgumentException& )
2715 std::unique_ptr<ScPatternAttr> pOldPattern;
2716 std::unique_ptr<ScPatternAttr> pNewPattern;
2718 sal_Int32 nFailed(0);
2724 if ( pEntry && ((pEntry->
nFlags & beans::PropertyAttribute::READONLY) == 0))
2731 pOldPattern->GetItemSet().ClearInvalidItems();
2738 sal_uInt16 nFirstItem, nSecondItem;
2743 pNewPattern->GetItemSet().Put( pOldPattern->GetItemSet().Get( nFirstItem ) );
2745 pNewPattern->GetItemSet().Put( pOldPattern->GetItemSet().Get( nSecondItem ) );
2747 catch ( lang::IllegalArgumentException& )
2749 pReturns[nFailed].Name = pNames[
i];
2750 pReturns[nFailed++].Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT;
2760 catch ( lang::IllegalArgumentException& )
2762 pReturns[nFailed].Name = pNames[
i];
2763 pReturns[nFailed++].Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT;
2769 pReturns[nFailed].Name = pNames[
i];
2771 pReturns[nFailed++].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO;
2773 pReturns[nFailed++].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
2780 aReturns.realloc(nFailed);
2784 return uno::Sequence < beans::SetPropertyTolerantFailed >();
2791 sal_Int32
nCount(aPropertyNames.getLength());
2792 uno::Sequence < beans::GetPropertyTolerantResult > aReturns(
nCount);
2793 beans::GetPropertyTolerantResult* pReturns = aReturns.getArray();
2802 pReturns[
i].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
2806 sal_uInt16 nItemWhich = 0;
2810 pReturns[
i].Result = beans::TolerantPropertySetResultType::SUCCESS;
2820 sal_Int32
nCount(aPropertyNames.getLength());
2821 uno::Sequence < beans::GetDirectPropertyTolerantResult > aReturns(
nCount);
2822 beans::GetDirectPropertyTolerantResult* pReturns = aReturns.getArray();
2832 pReturns[
i].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
2836 sal_uInt16 nItemWhich = 0;
2839 if (pReturns[j].
State == beans::PropertyState_DIRECT_VALUE)
2842 pReturns[j].Result = beans::TolerantPropertySetResultType::SUCCESS;
2843 pReturns[j].Name = aPropertyNames[
i];
2849 aReturns.realloc(j);
2915 xChartRanges =
new ScRangeList(
ScRange( nStartX, nStartY, nTab, nEndX, nEndY, nTab ) );
2918 if (!xChartRanges.
is())
2925 return aArr.CreateMemChart();
2936 sal_Int32 nColCount = pMemChart->GetColCount();
2937 sal_Int32 nRowCount =
static_cast<sal_Int32
>(pMemChart->GetRowCount());
2939 uno::Sequence< uno::Sequence<double> > aRowSeq( nRowCount );
2940 uno::Sequence<double>* pRowAry = aRowSeq.getArray();
2941 for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++)
2943 uno::Sequence<double> aColSeq( nColCount );
2944 double* pColAry = aColSeq.getArray();
2945 for (sal_Int32 nCol = 0; nCol < nColCount; nCol++)
2946 pColAry[nCol] = pMemChart->GetData( nCol, nRow );
2948 pRowAry[nRow] = aColSeq;
2970 sal_Int32 nEndColumn = nDataColumns - 1 + (
bChartColAsHdr ? 1 : 0 );
2971 if ( nEndColumn < 0 )
2973 if ( nEndColumn > rDoc.
MaxCol() )
2974 nEndColumn = rDoc.
MaxCol();
2979 if ( nEndRow > rDoc.
MaxRow() )
2983 return xChartRanges;
2994 sal_Int32 nRowCount =
aData.getLength();
2995 sal_Int32 nColCount = nRowCount ?
aData[0].getLength() : 0;
3008 for (sal_Int32 nRow=0; nRow<nRowCount; nRow++)
3010 const uno::Sequence<double>& rRowSeq =
aData[nRow];
3011 const double* pArray = rRowSeq.getConstArray();
3012 nColCount = rRowSeq.getLength();
3013 for (sal_Int32 nCol=0; nCol<nColCount; nCol++)
3016 sal::static_int_cast<SCCOL>(nCol),
3017 sal::static_int_cast<SCROW>(nRow) );
3020 double fVal = pArray[nCol];
3021 if ( fVal == DBL_MIN )
3024 rDoc.
SetValue(*pPos, pArray[nCol]);
3039 throw uno::RuntimeException();
3048 sal_Int32 nRowCount =
static_cast<sal_Int32
>(pMemChart->GetRowCount());
3049 uno::Sequence<OUString>
aSeq( nRowCount );
3050 OUString* pAry =
aSeq.getArray();
3051 for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++)
3052 pAry[nRow] = pMemChart->GetRowText(nRow);
3060 const uno::Sequence<OUString>& aRowDescriptions )
3066 sal_Int32 nRowCount = aRowDescriptions.getLength();
3078 const OUString* pArray = aRowDescriptions.getConstArray();
3079 for (sal_Int32 nRow=0; nRow<nRowCount; nRow++)
3082 static_cast<SCSIZE>(nRow) );
3085 const OUString&
aStr = pArray[nRow];
3108 throw uno::RuntimeException();
3117 sal_Int32 nColCount = pMemChart->GetColCount();
3118 uno::Sequence<OUString>
aSeq( nColCount );
3119 OUString* pAry =
aSeq.getArray();
3120 for (sal_Int32 nCol = 0; nCol < nColCount; nCol++)
3121 pAry[nCol] = pMemChart->GetColText(nCol);
3129 const uno::Sequence<OUString>& aColumnDescriptions )
3135 sal_Int32 nColCount = aColumnDescriptions.getLength();
3147 const OUString* pArray = aColumnDescriptions.getConstArray();
3148 for (sal_Int32 nCol=0; nCol<nColCount; nCol++)
3151 sal::static_int_cast<SCCOL>(nCol) );
3154 const OUString&
aStr = pArray[nCol];
3177 throw uno::RuntimeException();
3193 for (
auto const& it : rListeners)
3197 if (
p->GetUnoSource() ==
static_cast<chart::XChartData*
>(
this) &&
p->IsDirty())
3203 chart::XChartDataChangeEventListener >& aListener )
3215 if (
aName.isEmpty())
3220 pListener->
SetUno( aListener,
this );
3221 pColl->
insert( pListener );
3226 chart::XChartDataChangeEventListener >& aListener )
3233 pColl->
FreeUno( aListener,
this );
3246 return (nNumber == DBL_MIN);
3255 throw uno::RuntimeException();
3277 throw uno::RuntimeException();
3285 if ( rObj == aListener )
3315 SCCOL nCol = 0, nLastCol;
3316 while (nCol <= rDoc.
MaxCol())
3318 if (rDoc.
ColHidden(nCol, nTab,
nullptr, &nLastCol))
3322 nCol = nLastCol + 1;
3325 SCROW nRow = 0, nLastRow;
3326 while (nRow <= rDoc.
MaxRow())
3328 if (rDoc.
RowHidden(nRow, nTab,
nullptr, &nLastRow))
3332 nRow = nLastRow + 1;
3337 return new ScCellRangesObj(
pDocShell, aNewRanges );
3358 for (
bool bHasCell = aIter.
first(); bHasCell; bHasCell = aIter.
next())
3371 return new ScCellRangesObj(
pDocShell, aNewRanges );
3378 sal_Int16 nContentFlags )
3393 for (
bool bHasCell = aIter.
first(); bHasCell; bHasCell = aIter.
next())
3399 if ( nContentFlags & sheet::CellFlags::STRING )
3403 if ( (nContentFlags & sheet::CellFlags::STRING) || (nContentFlags & sheet::CellFlags::FORMATTED) )
3411 if ( (nContentFlags & (sheet::CellFlags::VALUE|sheet::CellFlags::DATETIME))
3412 == (sheet::CellFlags::VALUE|sheet::CellFlags::DATETIME) )
3421 if ((nTyp == SvNumFormatType::DATE) || (nTyp == SvNumFormatType::TIME) ||
3422 (nTyp == SvNumFormatType::DATETIME))
3424 if ( nContentFlags & sheet::CellFlags::DATETIME )
3429 if ( nContentFlags & sheet::CellFlags::VALUE )
3445 if (nContentFlags & sheet::CellFlags::ANNOTATION)
3447 std::vector<sc::NoteEntry> aNotes;
3450 for (
const auto&
i : aNotes)
3460 return new ScCellRangesObj(
pDocShell, aNewRanges );
3467 sal_Int32 nResultFlags )
3482 for (
bool bHasCell = aIter.
first(); bHasCell; bHasCell = aIter.
next())
3488 if (pFCell->
GetErrCode() != FormulaError::NONE)
3490 if ( nResultFlags & sheet::FormulaResult::ERROR )
3495 if ( nResultFlags & sheet::FormulaResult::VALUE )
3500 if ( nResultFlags & sheet::FormulaResult::STRING )
3514 return new ScCellRangesObj(
pDocShell, aNewRanges );
3521 const table::CellAddress& aCompare,
bool bColumnDiff)
3536 ScRange aCmpRange, aCellRange;
3538 aCmpRange =
ScRange( 0,nCmpPos,nTab, rDoc.
MaxCol(),nCmpPos,nTab );
3542 for (
bool bHasCell = aCmpIter.
first(); bHasCell; bHasCell = aCmpIter.
next())
3546 aCellRange =
ScRange(
static_cast<SCCOL>(nCellPos),0,nTab,
3547 static_cast<SCCOL>(nCellPos),rDoc.
MaxRow(),nTab );
3549 aCellRange =
ScRange( 0,nCellPos,nTab, rDoc.
MaxCol(),nCellPos,nTab );
3551 for (
i=0;
i<nRangeCount;
i++)
3575 for (
i=0;
i<nRangeCount;
i++)
3580 for (
bool bHasCell = aIter.
first(); bHasCell; bHasCell = aIter.
next())
3599 return new ScCellRangesObj(
pDocShell, aNewRanges );
3605 const table::CellAddress& aCompare )
3612 const table::CellAddress& aCompare )
3619 const table::CellRangeAddress& aRange )
3622 ScRange aMask(
static_cast<SCCOL>(aRange.StartColumn),
static_cast<SCROW>(aRange.StartRow), aRange.Sheet,
3623 static_cast<SCCOL>(aRange.EndColumn),
static_cast<SCROW>(aRange.EndRow), aRange.Sheet );
3638 return new ScCellRangesObj(
pDocShell, aNew );
3663 ScRange const & rRange = aNewRanges[ nR];
3665 for (
bool bHasCell = aIter.
first(); bHasCell; bHasCell = aIter.
next())
3674 if ( bRecursive && !bFound && !aMarkData.
IsAllMarked( aRefRange ) )
3683 while ( bRecursive && bFound );
3685 return new ScCellRangesObj(
pDocShell, aNewRanges );
3712 for (
bool bHasCell = aCellIter.
first(); bHasCell; bHasCell = aCellIter.
next())
3720 while ( aIter.
GetNextRef( aRefRange) && !bMark )
3722 size_t nRangesCount = aNewRanges.
size();
3723 for (
size_t nR = 0; nR < nRangesCount; ++nR)
3725 ScRange const & rRange = aNewRanges[ nR ];
3736 if ( bRecursive && !bFound && !aMarkData.
IsAllMarked( aCellRange ) )
3744 while ( bRecursive && bFound );
3746 return new ScCellRangesObj(
pDocShell, aNewRanges );
3760 const uno::Reference<util::XSearchDescriptor>& xDesc )
3764 uno::Reference<container::XIndexAccess> xRet;
3767 ScCellSearchObj* pSearch = comphelper::getFromUnoTunnel<ScCellSearchObj>( xDesc );
3774 pSearchItem->
SetCommand( SvxSearchCmd::FIND_ALL );
3780 OUString aDummyUndo;
3786 *pSearchItem, nCol, nRow, nTab, aMark, aMatchedRanges, aDummyUndo);
3790 xRet.set(
new ScCellRangesObj(
pDocShell, aMatchedRanges ));
3799 const uno::Reference<util::XSearchDescriptor>& xDesc,
3802 uno::Reference<uno::XInterface> xRet;
3805 ScCellSearchObj* pSearch = comphelper::getFromUnoTunnel<ScCellSearchObj>( xDesc );
3812 pSearchItem->
SetCommand( SvxSearchCmd::FIND );
3822 pLastPos->
GetVars( nCol, nRow, nTab );
3829 OUString aDummyUndo;
3832 *pSearchItem, nCol, nRow, nTab, aMark, aMatchedRanges, aDummyUndo);
3835 ScAddress aFoundPos( nCol, nRow, nTab );
3845 const uno::Reference<util::XSearchDescriptor>& xDesc )