41#include <unonames.hxx> 
   49#include <com/sun/star/container/XNameAccess.hpp> 
   50#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> 
   51#include <com/sun/star/lang/IllegalArgumentException.hpp> 
   52#include <com/sun/star/lang/NullPointerException.hpp> 
   53#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> 
   54#include <com/sun/star/sheet/XDimensionsSupplier.hpp> 
   55#include <com/sun/star/sheet/XLevelsSupplier.hpp> 
   56#include <com/sun/star/sheet/XMembersAccess.hpp> 
   57#include <com/sun/star/beans/PropertyAttribute.hpp> 
   58#include <com/sun/star/sheet/DataImportMode.hpp> 
   59#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp> 
   60#include <com/sun/star/sheet/DataPilotFieldFilter.hpp> 
   61#include <com/sun/star/sheet/DataPilotOutputRangeType.hpp> 
   62#include <com/sun/star/sheet/DataPilotTablePositionData.hpp> 
   63#include <com/sun/star/sheet/GeneralFunction2.hpp> 
   74using ::com::sun::star::uno::Any;
 
   75using ::com::sun::star::uno::Exception;
 
   76using ::com::sun::star::uno::Reference;
 
   77using ::com::sun::star::uno::RuntimeException;
 
   78using ::com::sun::star::uno::Sequence;
 
   79using ::com::sun::star::uno::UNO_QUERY;
 
   80using ::com::sun::star::uno::UNO_QUERY_THROW;
 
   82using ::com::sun::star::container::ElementExistException;
 
   83using ::com::sun::star::container::NoSuchElementException;
 
   84using ::com::sun::star::container::XEnumeration;
 
   85using ::com::sun::star::container::XIndexAccess;
 
   86using ::com::sun::star::container::XNameAccess;
 
   87using ::com::sun::star::container::XNamed;
 
   89using ::com::sun::star::beans::UnknownPropertyException;
 
   90using ::com::sun::star::beans::XPropertyChangeListener;
 
   91using ::com::sun::star::beans::XPropertySet;
 
   92using ::com::sun::star::beans::XPropertySetInfo;
 
   93using ::com::sun::star::beans::XVetoableChangeListener;
 
   95using ::com::sun::star::lang::IllegalArgumentException;
 
   96using ::com::sun::star::lang::IndexOutOfBoundsException;
 
   97using ::com::sun::star::lang::NullPointerException;
 
   99using ::com::sun::star::table::CellAddress;
 
  100using ::com::sun::star::table::CellRangeAddress;
 
  119    return aDataPilotDescriptorBaseMap_Impl;
 
  124    using namespace ::com::sun::star::beans::PropertyAttribute;
 
  147    return aDataPilotFieldMap_Impl;
 
  158    return aDataPilotItemMap_Impl;
 
  161bool lclCheckValidDouble( 
double fValue, 
bool bAuto )
 
  163    return bAuto || std::isfinite( fValue );
 
  166bool lclCheckMinMaxStep( 
const DataPilotFieldGroupInfo& rInfo )
 
  169        lclCheckValidDouble( rInfo.Start, rInfo.HasAutoStart ) &&
 
  170        lclCheckValidDouble( rInfo.End, rInfo.HasAutoEnd ) &&
 
  171        (rInfo.HasAutoStart || rInfo.HasAutoEnd || (rInfo.Start <= rInfo.End)) &&
 
  172        lclCheckValidDouble( rInfo.Step, 
false ) &&
 
  241    rInfo.Start         = rGroupInfo.
mfStart;
 
  243    rInfo.End           = rGroupInfo.
mfEnd;
 
  244    rInfo.Step          = rGroupInfo.
mfStep;
 
  286        for ( sal_Int32 nDim = 0; nDim < 
nCount; ++nDim )
 
  288            bool bIsDataLayout = 
false;
 
  289            OUString aDimName( pDPObj->
GetDimName( nDim, bIsDataLayout ) );
 
  298    pDocShell( &rDocSh ),
 
  316    if ( rHint.
GetId() == SfxHintId::Dying )
 
  333            sal_Int32 nFound = 0;
 
  372        Reference< XNamed > xOriginal( aAny, UNO_QUERY );
 
  373        return xOriginal.is();
 
  383    Reference< XNamed > xOriginal;
 
  385    Reference< XPropertySet > xDimProps(rDim, UNO_QUERY);
 
  386    if ( xDimProps.is() )
 
  398    if ( !xOriginal.is() )
 
  401    return xOriginal->getName();
 
  405    const CellAddress& aOutputAddress,
 
  406    const Reference<XDataPilotDescriptor>& xDescriptor )
 
  409    if (!xDescriptor.is()) 
return;
 
  411    if ( !aNewName.isEmpty() && 
hasByName( aNewName ) )
 
  412        throw IllegalArgumentException(
"Name \"" + aNewName + 
"\" already exists", getXWeak(), 0);
 
  425    ScRange aOutputRange(
static_cast<SCCOL>(aOutputAddress.Column), 
static_cast<SCROW>(aOutputAddress.Row), 
static_cast<SCTAB>(aOutputAddress.Sheet),
 
  426                        static_cast<SCCOL>(aOutputAddress.Column), 
static_cast<SCROW>(aOutputAddress.Row), 
static_cast<SCTAB>(aOutputAddress.Sheet));
 
  428    OUString 
aName = aNewName;
 
  432    OUString aTag = xDescriptor->getTag();
 
  475            sal_uInt16 nFound = 0;
 
  495        throw IndexOutOfBoundsException();
 
  496    return Any( xTable );
 
  517        throw NoSuchElementException();
 
  518    return Any( xTable );
 
  532            sal_uInt16 nFound = 0;
 
  543            Sequence<OUString> 
aSeq(nFound);
 
  544            OUString* pAry = 
aSeq.getArray();
 
  581    maPropSet( lcl_GetDataPilotDescriptorBaseMap() ),
 
  599    if ( rHint.
GetId() == SfxHintId::Dying )
 
  615    CellRangeAddress aRet;
 
  686    static Reference<XPropertySetInfo> aRef =
 
  699    OSL_ENSURE(pOldData, 
"Here should be a SaveData");
 
  731            if ( aValue >>= aStrVal )
 
  736            uno::Sequence<beans::PropertyValue> aArgSeq;
 
  737            if ( aValue >>= aArgSeq )
 
  743                    aImportDesc = *pOldDesc;
 
  748                sheet::DataImportMode nNewType = sheet::DataImportMode_NONE;
 
  752                        nNewType = sheet::DataImportMode_SQL;
 
  754                        nNewType = sheet::DataImportMode_QUERY;
 
  756                        nNewType = sheet::DataImportMode_TABLE;
 
  758                aImportDesc.
nType   = nNewType;
 
  769            if ( aValue >>= aStrVal )
 
  775                    aServiceDesc = *pOldDesc;
 
  784            uno::Sequence<beans::PropertyValue> aArgSeq;
 
  785            if ( aValue >>= aArgSeq )
 
  791                    aServiceDesc = *pOldDesc;
 
  794                for (
const beans::PropertyValue& rProp : std::as_const(aArgSeq))
 
  800                        if ( rProp.Value >>= aStrVal )
 
  805                        if ( rProp.Value >>= aStrVal )
 
  810                        if ( rProp.Value >>= aStrVal )
 
  815                        if ( rProp.Value >>= aStrVal )
 
  824            throw UnknownPropertyException(aPropertyName);
 
  841        OSL_ENSURE(pOldData, 
"Here should be a SaveData");
 
  874                    aRet <<= *pGrandTotalName;      
 
  883                    aParam.
bImport    = ( pImportDesc->
nType != sheet::DataImportMode_NONE );
 
  887                    aParam.
bSql       = ( pImportDesc->
nType == sheet::DataImportMode_SQL );
 
  897                    uno::Sequence<beans::PropertyValue> aEmpty(0);
 
  903                OUString aServiceName;
 
  907                aRet <<= aServiceName;      
 
  925                    uno::Sequence<beans::PropertyValue> aEmpty;
 
  930                throw UnknownPropertyException(aPropertyName);
 
  938        const OUString& , 
const Reference<XPropertyChangeListener >&  )
 
  943        const OUString& , 
const Reference<XPropertyChangeListener >&  )
 
  948        const OUString& , 
const Reference<XVetoableChangeListener >&  )
 
  953        const OUString& , 
const Reference<XVetoableChangeListener >&  )
 
  964        if( 
ScDPSaveData* pSaveData = pDPObject->GetSaveData() )
 
  966            if( pSaveData->GetDataLayoutDimension() )
 
  980    aModifyListeners( 0 )
 
  996    return ScDataPilotDescriptorBase::queryInterface( rType );
 
 1001    ScDataPilotDescriptorBase::acquire();
 
 1006    ScDataPilotDescriptorBase::release();
 
 1012        ScDataPilotDescriptorBase::getTypes(),
 
 1013        Sequence< uno::Type >
 
 1022    return css::uno::Sequence<sal_Int8>();
 
 1034    if ( pDPObj && pDocSh )
 
 1083        pDPObj->
SetTag( aNewTag );      
 
 1095    CellRangeAddress aRet;
 
 1103        aRet.EndColumn   = aRange.
aEnd.
Col();
 
 1104        aRet.EndRow      = aRange.
aEnd.
Row();
 
 1123    Sequence< Sequence<Any> > aTabData;
 
 1124    ScAddress aAddr2(
static_cast<SCCOL>(aAddr.Column), 
static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
 
 1136    DataPilotTablePositionData aPosData;
 
 1137    ScAddress aAddr2(
static_cast<SCCOL>(aAddr.Column), 
static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
 
 1156    Sequence<DataPilotFieldFilter> aFilters;
 
 1158        ScAddress(
static_cast<SCCOL>(aAddr.Column), 
static_cast<SCROW>(aAddr.Row), aAddr.Sheet), aFilters);
 
 1165    if (nType < 0 || nType > DataPilotOutputRangeType::RESULT)
 
 1166        throw IllegalArgumentException(
"nType must be between 0 and " +
 
 1167                OUString::number(DataPilotOutputRangeType::RESULT) + 
", got " + OUString::number(
nType),
 
 1170    CellRangeAddress aRet;
 
 1198        if ( rObj == aListener )
 
 1216        if (pDataPilotHint->GetName() == 
aName)
 
 1219    else if ( 
auto pRefHint = 
dynamic_cast<const ScUpdateRefHint*
>(&rHint) )
 
 1224                 pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() ) &&
 
 1225             aRanges.
size() == 1 )
 
 1236    lang::EventObject 
aEvent;
 
 1237    aEvent.Source = getXWeak();
 
 1242    for (
const uno::Reference<util::XModifyListener> & xModifyListener : 
aModifyListeners)
 
 1248    mpDPObject(new 
ScDPObject(&rDocSh.GetDocument()))
 
 1275        OSL_FAIL(
"replace DPObject should not happen");
 
 1312    maFieldId(
std::move( aFieldId ))
 
 1327    mxParent->SetDPObject( pDPObject );
 
 1334        if( ppDPObject ) *ppDPObject = pDPObj;
 
 1338                return pSaveData->GetDataLayoutDimension();
 
 1346            sal_Int32 nFoundIdx = 0;
 
 1347            for (
auto const& it : rDims)
 
 1349                if (it->IsDataLayout())
 
 1368    Reference<XNameAccess> xMembersNA = 
GetMembers();
 
 1369    if (xMembersNA.is())
 
 1372        nRet = xMembersIA->getCount();
 
 1379    Reference< XMembersAccess > xMembersNA;
 
 1405static sal_Int32 
lcl_GetFieldCount( 
const Reference<XDimensionsSupplier>& rSource, 
const Any& rOrient )
 
 1408        throw NullPointerException();
 
 1412    Reference<XNameAccess> xDimsName(rSource->getDimensions());
 
 1414    sal_Int32 nIntCount = xIntDims->getCount();
 
 1415    for (sal_Int32 
i = 0; 
i < nIntCount; ++
i)
 
 1417        Reference<XPropertySet> xDim(xIntDims->getByIndex(
i), UNO_QUERY);
 
 1418        const bool bMatch = xDim
 
 1419                            && (rOrient.hasValue()
 
 1435        throw NullPointerException();
 
 1439    sal_Int32 nDimIndex = 0;
 
 1441    Reference<XNameAccess> xDimsName(rSource->getDimensions());
 
 1443    sal_Int32 nIntCount = xIntDims->getCount();
 
 1444    Reference<XPropertySet> xDim;
 
 1445    for (sal_Int32 
i = 0; 
i < nIntCount; ++
i)
 
 1447        xDim.set(xIntDims->getByIndex(
i), UNO_QUERY);
 
 1448        const bool bMatch = xDim
 
 1449                            && (rOrient.hasValue()
 
 1467        xDim.set( xIntDims->getByIndex(nDimIndex), UNO_QUERY );
 
 1468        Reference<XNamed> xDimName( xDim, UNO_QUERY );
 
 1469        if ( xDimName.is() )
 
 1476            sal_Int32 nRepeat = 0;
 
 1482                Reference<XNamed> xPrevName;
 
 1483                for (sal_Int32 
i = 0; 
i < nDimIndex; ++
i)
 
 1485                    xPrevName.set( xIntDims->getByIndex(
i), UNO_QUERY );
 
 1542    return new ScIndexEnumeration(
this, 
"com.sun.star.sheet.DataPilotFieldsEnumeration");
 
 1559        throw IndexOutOfBoundsException();
 
 1560    return Any( xField );
 
 1583        throw NoSuchElementException();
 
 1584    return Any( xField );
 
 1593        OUString* pAry = 
aSeq.getArray();
 
 1596        for (
auto const& it : rDimensions)
 
 1598            if(
maOrient.hasValue() && (it->GetOrientation() == 
maOrient.get< DataPilotFieldOrientation >()))
 
 1600                *pAry = it->GetName();
 
 1606    return Sequence<OUString>();
 
 1619    maPropSet( lcl_GetDataPilotFieldMap() )
 
 1626    maPropSet( lcl_GetDataPilotFieldMap() ),
 
 1627    maOrient(
std::move( aOrient ))
 
 1643        if( pDim->IsDataLayout() )
 
 1647            const std::optional<OUString> & pLayoutName = pDim->GetLayoutName();
 
 1649                aName = *pLayoutName;
 
 1651                aName = pDim->GetName();
 
 1674    static Reference<XPropertySetInfo> aRef(
 
 1695        uno::Sequence<sheet::GeneralFunction> 
aSeq;
 
 1696        if( aValue >>= 
aSeq)
 
 1698            std::vector< ScGeneralFunction > aSubTotals(
aSeq.getLength());
 
 1699            std::transform(std::cbegin(
aSeq), std::cend(
aSeq), aSubTotals.begin(),
 
 1701                    const int nValAsInt = static_cast<int>(rValue);
 
 1702                    return static_cast<ScGeneralFunction>(nValAsInt);
 
 1709        Sequence< sal_Int16 > 
aSeq;
 
 1710        if( aValue >>= 
aSeq )
 
 1712            std::vector< ScGeneralFunction > aSubTotals(
aSeq.getLength());
 
 1713            std::transform(std::cbegin(
aSeq), std::cend(
aSeq), aSubTotals.begin(),
 
 1726        OUString sCurrentPage;
 
 1727        if (aValue >>= sCurrentPage)
 
 1741        DataPilotFieldAutoShowInfo aInfo;
 
 1742        if (aValue >>= aInfo)
 
 1752        DataPilotFieldLayoutInfo aInfo;
 
 1753        if (aValue >>= aInfo)
 
 1763        DataPilotFieldReference aRef;
 
 1764        if (aValue >>= aRef)
 
 1774        DataPilotFieldSortInfo aInfo;
 
 1775        if (aValue >>= aInfo)
 
 1785        DataPilotFieldGroupInfo aInfo;
 
 1786        if (aValue >>= aInfo)
 
 1800        if (aValue >>= 
sName)
 
 1812        sheet::GeneralFunction eVal;
 
 1814        if (nFunction == sheet::GeneralFunction2::MEDIAN)
 
 1816            eVal = sheet::GeneralFunction_NONE;
 
 1820            eVal = 
static_cast<sheet::GeneralFunction
>(nFunction);
 
 1829        uno::Sequence<sheet::GeneralFunction>  aNewSeq(
aSeq.getLength());
 
 1830        std::transform(
aSeq.begin(), 
aSeq.end(), aNewSeq.getArray(),
 
 1831            [](sal_Int16 nFunc) -> sheet::GeneralFunction {
 
 1832                if (nFunc == sheet::GeneralFunction2::MEDIAN)
 
 1833                    return sheet::GeneralFunction_NONE;
 
 1834                return static_cast<sheet::GeneralFunction>(nFunc);
 
 1845        aRet <<= OUString();
 
 1876        const DataPilotFieldSortInfo* pInfo = 
getSortInfo();
 
 1912    return pDim ? pDim->
GetOrientation() : DataPilotFieldOrientation_HIDDEN;
 
 1918    if (
maOrient.hasValue() && (eNew == 
maOrient.get< DataPilotFieldOrientation >()))
 
 1933         (eNew == DataPilotFieldOrientation_DATA) )
 
 1940        sal_Int32 nFound = 0;
 
 1942        for (
auto const& it : rDimensions)
 
 1946                if ( it->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
 
 1979        if( pDim->GetOrientation() != DataPilotFieldOrientation_DATA )
 
 1982            tools::Long nSubCount = pDim->GetSubTotalsCount();
 
 1983            if ( nSubCount > 0 )
 
 1984                eRet = 
static_cast<sal_Int16
>(pDim->GetSubTotalFunc(0));    
 
 1988            eRet = 
static_cast<sal_Int16
>(pDim->GetFunction());
 
 2004        std::vector<ScGeneralFunction> nSubTotalFuncs;
 
 2007            nSubTotalFuncs.push_back( eNewFunc );
 
 2019    Sequence< sal_Int16 > aRet;
 
 2022        if( pDim->GetOrientation() != DataPilotFieldOrientation_DATA )
 
 2025            sal_Int32 
nCount = 
static_cast< sal_Int32 
>( pDim->GetSubTotalsCount() );
 
 2029                auto pRet = aRet.getArray();
 
 2030                for( sal_Int32 nIdx = 0; nIdx < 
nCount; ++nIdx )
 
 2031                    pRet[ nIdx ] = 
static_cast<sal_Int16
>(pDim->GetSubTotalFunc( nIdx ));
 
 2048        sal_Int32 
nCount = rSubtotals.size();
 
 2052            std::vector<ScGeneralFunction> nTmpFuncs;
 
 2055                nTmpFuncs.push_back( rSubtotals[ 0 ] );
 
 2062            ::std::vector< ScGeneralFunction > aSubt;
 
 2063            for( sal_Int32 nIdx = 0; nIdx < 
nCount; ++nIdx )
 
 2069                    if( ::std::find( aSubt.begin(), aSubt.end(), eFunc ) == aSubt.end() )
 
 2070                        aSubt.push_back( eFunc );
 
 2086        pDim->SetCurrentPage( &rPage );
 
 2103        const OUString aPage;
 
 2124        pDim->SetAutoShowInfo( pInfo );
 
 2142        pDim->SetLayoutInfo( pInfo );
 
 2160        pDim->SetReferenceValue( pInfo );
 
 2178        pDim->SetSortInfo( pInfo );
 
 2196        pDim->SetShowEmpty( bShow );
 
 2214        pDim->SetRepeatItemLabels( bShow );
 
 2225            return pDimData->GetNamedGroupDim( pDim->GetName() ) || pDimData->GetNumGroupDim( pDim->GetName() );
 
 2232    DataPilotFieldGroupInfo aInfo;
 
 2241                aInfo.GroupBy = pGroupDim->GetDatePart();
 
 2246                    Reference< XNameAccess > xFields( 
mxParent->getDataPilotFields(), UNO_QUERY_THROW );
 
 2247                    aInfo.SourceField.set( xFields->getByName( pGroupDim->GetSourceDimName() ), UNO_QUERY );
 
 2254                if( pGroupDim->GetDatePart() == 0 )
 
 2258                    for( sal_Int32 nIdx = 0, 
nCount = pGroupDim->GetGroupCount(); nIdx < 
nCount; ++nIdx )
 
 2263                        for( sal_Int32 nMemIdx = 0, nMemCount = rGroup.
GetElementCount(); nMemIdx < nMemCount; ++nMemIdx )
 
 2266                        aGroups.push_back( aGroup );
 
 2273                if (pNumGroupDim->GetDatePart())
 
 2276                    aInfo.GroupBy = pNumGroupDim->GetDatePart();
 
 2296    if( pInfo && lclCheckMinMaxStep( *pInfo ) )
 
 2304        aInfo.
mfEnd = pInfo->End;
 
 2305        aInfo.
mfStep = pInfo->Step;
 
 2306        Reference< XNamed > xNamed( pInfo->SourceField, UNO_QUERY );
 
 2310            if( pInfo->GroupBy )
 
 2314                Reference<XIndexAccess> xIndex(pInfo->Groups, UNO_QUERY);
 
 2317                    sal_Int32 
nCount(xIndex->getCount());
 
 2320                        Reference<XNamed> xGroupNamed(xIndex->getByIndex(
i), UNO_QUERY);
 
 2321                        if (xGroupNamed.is())
 
 2324                            Reference<XIndexAccess> xGroupIndex(xGroupNamed, UNO_QUERY);
 
 2325                            if (xGroupIndex.is())
 
 2327                                sal_Int32 nItemCount(xGroupIndex->getCount());
 
 2328                                for (sal_Int32 j = 0; j < nItemCount; ++j)
 
 2330                                    Reference<XNamed> xItemNamed(xGroupIndex->getByIndex(j), UNO_QUERY);
 
 2331                                    if (xItemNamed.is())
 
 2357            else if (pInfo->GroupBy)
 
 2385    if( !rItems.hasElements() )
 
 2386        throw IllegalArgumentException(
"rItems is empty", getXWeak(), 0);
 
 2388    Reference< XMembersAccess > xMembers = 
GetMembers();
 
 2391        SAL_WARN(
"sc.ui", 
"Cannot access members of the field object.");
 
 2392        throw RuntimeException(
"Cannot access members of the field object", getXWeak());
 
 2400            throw IllegalArgumentException(
"There is no member with name \"" + 
aEntryName + 
"\"", getXWeak(), 0);
 
 2404    Reference< XDataPilotField > xRet;
 
 2409        const OUString& aDimName = pDim->
GetName();
 
 2415        OUString aBaseDimName( aDimName );
 
 2417        if ( pBaseGroupDim )
 
 2429        if ( pGroupDimension )
 
 2433                if ( pBaseGroupDim )
 
 2448        std::unique_ptr<ScDPSaveGroupDimension> pNewGroupDim;
 
 2449        if ( !pGroupDimension )
 
 2455            pGroupDimension = pNewGroupDim.get();     
 
 2457            if ( pBaseGroupDim )
 
 2467                for ( 
tools::Long nGroup = 0; nGroup < nGroupCount; nGroup++ )
 
 2487            if ( pBaseGroupDim )
 
 2505            pNewGroupDim.reset();        
 
 2508        pGroupDimension = 
nullptr;
 
 2512        if ( pSaveDimension->
GetOrientation() == DataPilotFieldOrientation_HIDDEN )
 
 2525    if( !sNewDim.isEmpty() )
 
 2527        Reference< XNameAccess > xFields(
mxParent->getDataPilotFields(), UNO_QUERY);
 
 2532                xRet.set(xFields->getByName(sNewDim), UNO_QUERY);
 
 2533                SAL_WARN_IF(!xRet.is(), 
"sc.ui", 
"there is a name, so there should be also a field");
 
 2535            catch (
const container::NoSuchElementException&)
 
 2538                SAL_WARN(
"sc.ui", 
"Cannot find field with that name: " + sNewDim + 
".");
 
 2540                throw css::lang::WrappedTargetRuntimeException(
 
 2541                        "Cannot find field with name \"" + sNewDim + 
"\"",
 
 2542                        getXWeak(), anyEx );
 
 2552    using namespace ::com::sun::star::sheet::DataPilotFieldGroupBy;
 
 2554    if( !rInfo.HasDateValues )
 
 2555        throw IllegalArgumentException(
"HasDateValues is not set", getXWeak(), 0);
 
 2556    if( !lclCheckMinMaxStep( rInfo ) )
 
 2557        throw IllegalArgumentException(
"min/max/step", getXWeak(), 0);
 
 2560    if( (rInfo.GroupBy == 0) || (rInfo.GroupBy > YEARS) || ((rInfo.GroupBy & (rInfo.GroupBy - 1)) != 0) )
 
 2561        throw IllegalArgumentException(
"Invalid GroupBy value: " + OUString::number(rInfo.GroupBy), getXWeak(), 0);
 
 2564    if( rInfo.Step >= ((rInfo.GroupBy == DAYS) ? 32768.0 : 1.0) )
 
 2565        throw IllegalArgumentException(
"Invalid step value: " + OUString::number(rInfo.Step), getXWeak(), 0);
 
 2567    OUString aGroupDimName;
 
 2573        aInfo.
mbDateValues = (rInfo.GroupBy == DAYS) && (rInfo.Step >= 1.0);
 
 2577        aInfo.
mfEnd = rInfo.End;
 
 2578        aInfo.
mfStep = std::trunc( rInfo.Step );
 
 2586        const OUString& rDimName = pDim->GetName();
 
 2588        OUString aSrcDimName = pGroupDim ? pGroupDim->
GetSourceDimName() : rDimName;
 
 2597        if( bHasNamedGrouping || bHasNumGrouping )
 
 2598            throw IllegalArgumentException();
 
 2621            if( nDateParts == 0 )
 
 2627            else if( (nDateParts & rInfo.GroupBy) == 0 )    
 
 2636                if( rSaveDim.
GetOrientation() == DataPilotFieldOrientation_HIDDEN )
 
 2651    Reference< XDataPilotField > xRet;
 
 2652    if( !aGroupDimName.isEmpty() )
 
 2655           Reference< XNameAccess > xFields( 
mxParent->getDataPilotFields(), UNO_QUERY_THROW );
 
 2656           xRet.set( xFields->getByName( aGroupDimName ), UNO_QUERY );
 
 2669    if( !rElement.hasValue() )
 
 2673    Sequence< OUString > 
aSeq;
 
 2674    if( rElement >>= aSeq )
 
 2676        if( 
aSeq.hasElements() )
 
 2677            rMembers.insert( rMembers.end(), std::cbegin(aSeq), std::cend(aSeq) );
 
 2682    Reference< XIndexAccess > xItemsIA( rElement, UNO_QUERY );
 
 2685        for( sal_Int32 nIdx = 0, nCount = xItemsIA->getCount(); nIdx < nCount; ++nIdx )
 
 2689                Reference< XNamed > xItemName( xItemsIA->getByIndex( nIdx ), UNO_QUERY_THROW );
 
 2690                rMembers.push_back( xItemName->getName() );
 
 2707    maGroups( 
std::move(rGroups) )
 
 2721        throw NoSuchElementException();
 
 2728    Sequence< OUString > 
aSeq;
 
 2731        aSeq.realloc( 
static_cast< sal_Int32 
>( 
maGroups.size() ) );
 
 2733        for( 
const auto& rGroup : 
maGroups )
 
 2735            *
pName = rGroup.maName;
 
 2754    if( rName.isEmpty() )
 
 2755        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2759        throw NoSuchElementException(
"Name \"" + rName + 
"\" not found", getXWeak());
 
 2763    if( !lclExtractGroupMembers( aMembers, rElement ) )
 
 2764        throw IllegalArgumentException(
"Invalid element object", getXWeak(), 0);
 
 2767    aIt->maMembers.swap( aMembers );
 
 2776    if( rName.isEmpty() )
 
 2777        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2781        throw ElementExistException(
"Name \"" + rName + 
"\" already exists", getXWeak());
 
 2785    if( !lclExtractGroupMembers( aMembers, rElement ) )
 
 2786        throw IllegalArgumentException(
"Invalid element object", getXWeak(), 0);
 
 2799    if( rName.isEmpty() )
 
 2800        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2804        throw NoSuchElementException(
"Name \"" + rName + 
"\" not found", getXWeak());
 
 2814    return static_cast< sal_Int32 
>( 
maGroups.size() );
 
 2821        throw IndexOutOfBoundsException();
 
 2830    return new ScIndexEnumeration( 
this, 
"com.sun.star.sheet.DataPilotFieldGroupsEnumeration" );
 
 2853        throw RuntimeException(
"Field Group with name \"" + rName + 
"\" not found", getXWeak());
 
 2863        throw RuntimeException(
"Field Group with name \"" + rOldName + 
"\" not found", getXWeak());
 
 2865    if( (aNewIt != 
maGroups.end()) && (aNewIt != aOldIt) )
 
 2866        throw RuntimeException(
"Field Group with name \"" + rOldName + 
"\" already exists", getXWeak());
 
 2867    aOldIt->maName = rNewName;
 
 2873        [&rName](
const ScFieldGroup& rGroup) { return rGroup.maName == rName; });
 
 2878OUString lclExtractMember( 
const Any& rElement )
 
 2880    if( rElement.has< OUString >() )
 
 2881        return rElement.get< OUString >();
 
 2883    Reference< XNamed > xNamed( rElement, UNO_QUERY );
 
 2885        return xNamed->getName();
 
 2894    maGroupName(
std::move( aGroupName ))
 
 2908    ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
 
 2909    if( aIt == rMembers.end() )
 
 2910        throw NoSuchElementException(
"Name \"" + rName + 
"\" not found", getXWeak());
 
 2917    return ::comphelper::containerToSequence( 
mxParent->getFieldGroup( 
maGroupName ).maMembers );
 
 2924    return ::std::find( rMembers.begin(), rMembers.end(), rName ) != rMembers.end();
 
 2934    OUString aNewName = lclExtractMember( rElement );
 
 2935    if( rName.isEmpty() || aNewName.isEmpty() )
 
 2936        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2937    if( rName == aNewName )
 
 2941    ScFieldGroupMembers::iterator aOldIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
 
 2942    ScFieldGroupMembers::iterator aNewIt = ::std::find( rMembers.begin(), rMembers.end(), aNewName );
 
 2943    if( aOldIt == rMembers.end() )
 
 2944        throw NoSuchElementException(
"Name \"" + rName + 
"\" not found", getXWeak());
 
 2945    if( aNewIt != rMembers.end() )
 
 2946        throw IllegalArgumentException(
"Name \"" + rName + 
"\" already exists", getXWeak(), 0);
 
 2957    if( rName.isEmpty() )
 
 2958        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2961    ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
 
 2962    if( aIt != rMembers.end() )
 
 2963        throw IllegalArgumentException(
"Name \"" + rName + 
"\" already exists", getXWeak(), 0);
 
 2964    rMembers.push_back( rName );
 
 2971    if( rName.isEmpty() )
 
 2972        throw IllegalArgumentException(
"Name is empty", getXWeak(), 0);
 
 2974    ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
 
 2975    if( aIt == rMembers.end() )
 
 2976        throw NoSuchElementException(
"Name \"" + rName + 
"\" not found", getXWeak());
 
 2977    rMembers.erase( aIt );
 
 2985    return static_cast< sal_Int32 
>( 
mxParent->getFieldGroup( 
maGroupName ).maMembers.size() );
 
 2993        throw IndexOutOfBoundsException();
 
 3002    return new ScIndexEnumeration( 
this, 
"com.sun.star.sheet.DataPilotFieldGroupEnumeration" );
 
 3082    Reference<XNameAccess> xMembers = 
GetMembers();
 
 3086        sal_Int32 
nCount = xMembersIndex->getCount();
 
 3087        sal_Int32 nItem = 0;
 
 3090            Reference<XNamed> xMember(xMembersIndex->getByIndex(nItem), UNO_QUERY);
 
 3091            if (xMember.is() && (
aName == xMember->getName()))
 
 3097        throw NoSuchElementException(
"Name \"" + 
aName + 
"\" not found", getXWeak());
 
 3105    Sequence< OUString > 
aSeq;
 
 3114    bool bFound = 
false;
 
 3115    Reference<XNameAccess> xMembers = 
GetMembers();
 
 3119        sal_Int32 
nCount = xMembersIndex->getCount();
 
 3120        sal_Int32 nItem = 0;
 
 3121        while (nItem < 
nCount && !bFound )
 
 3123            Reference<XNamed> xMember(xMembersIndex->getByIndex(nItem), UNO_QUERY);
 
 3124            if (xMember.is() && 
aName == xMember->getName())
 
 3154        throw IndexOutOfBoundsException();
 
 3155    return Any( xItem );
 
 3171    maPropSet( lcl_GetDataPilotItemMap() ),
 
 3185    Reference<XNameAccess> xMembers = 
GetMembers();
 
 3189        sal_Int32 
nCount = xMembersIndex->getCount();
 
 3192            Reference<XNamed> xMember(xMembersIndex->getByIndex(
mnIndex), UNO_QUERY);
 
 3193            sRet = xMember->getName();
 
 3204Reference< XPropertySetInfo >
 
 3208    static Reference<XPropertySetInfo> aRef =
 
 3221    Reference<XNameAccess> xMembers = 
GetMembers();
 
 3222    if( !xMembers.is() )
 
 3226    sal_Int32 
nCount = xMembersIndex->getCount();
 
 3230    Reference<XNamed> xMember(xMembersIndex->getByIndex(
mnIndex), UNO_QUERY);
 
 3231    OUString 
sName(xMember->getName());
 
 3236    bool bGetNewIndex = 
false;
 
 3243        sal_Int32 nNewPos = 0;
 
 3244        if ( !( aValue >>= nNewPos ) || nNewPos < 0 || nNewPos >= 
nCount )
 
 3245            throw IllegalArgumentException();
 
 3249        bGetNewIndex = 
true;
 
 3256        Sequence< OUString > aItemNames = xMembers->getElementNames();
 
 3257        sal_Int32 nItemCount = aItemNames.getLength();
 
 3258        for (sal_Int32 nItem=0; nItem<nItemCount; ++nItem)
 
 3259            if (aItemNames[nItem] == 
sName)
 
 3270        Reference< XNameAccess > xMembers = 
GetMembers();
 
 3274            sal_Int32 
nCount = xMembersIndex->getCount();
 
 3277                Reference< XNamed > xMember( xMembersIndex->getByIndex( 
mnIndex ), UNO_QUERY );
 
 3278                OUString 
sName( xMember->getName() );
 
 3288                        Reference< XPropertySet > xMemberProps( xMember, UNO_QUERY );
 
 3289                        if( xMemberProps.is() )
 
 3303                        Reference< XPropertySet > xMemberProps( xMember, UNO_QUERY );
 
 3304                        if( xMemberProps.is() )
 
 3321        const OUString& , 
const Reference< XPropertyChangeListener >&  )
 
 3326        const OUString& , 
const Reference< XPropertyChangeListener >&  )
 
 3331        const OUString& , 
const Reference< XVetoableChangeListener >&  )
 
 3336        const OUString& , 
const Reference< XVetoableChangeListener >&  )
 
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 ...
unotools::WeakReference< AnimationNode > mxParent
bool RemovePivotTable(const ScDPObject &rDPObj, bool bRecord, bool bApi)
void RefreshPivotTables(const ScDPObject *pDPObj, bool bApi)
Reload the referenced pivot cache, and refresh all pivot tables that reference the cache.
bool DataPilotUpdate(ScDPObject *pOldObj, const ScDPObject *pNewObj, bool bRecord, bool bApi, bool bAllowMove=false)
void RefreshPivotTableGroups(ScDPObject *pDPObj)
Refresh the group dimensions of all pivot tables referencing the same cache.
bool CreatePivotTable(const ScDPObject &rDPObj, bool bRecord, bool bApi)
void ShowDataPilotSourceData(ScDPObject &rDPObj, const css::uno::Sequence< css::sheet::DataPilotFieldFilter > &rFilters)
SC_DLLPUBLIC size_t GetCount() const
OUString CreateNewName() const
Create a new name that's not yet used by any existing data pilot objects.
This class has to do with handling exclusively grouped dimensions? TODO: Find out what this class doe...
const ScDPSaveGroupDimension * GetNamedGroupDim(const OUString &rGroupDimName) const
OUString CreateGroupDimName(const OUString &rSourceName, const ScDPObject &rObject, bool bAllowSource, const ::std::vector< OUString > *pDeletedNames)
void ReplaceNumGroupDimension(const ScDPSaveNumGroupDimension &rGroupDim)
sal_Int32 CollectDateParts(const OUString &rBaseDimName) const
void ReplaceGroupDimension(const ScDPSaveGroupDimension &rGroupDim)
const ScDPSaveGroupDimension * GetFirstNamedGroupDim(const OUString &rBaseDimName) const
void AddNumGroupDimension(const ScDPSaveNumGroupDimension &rGroupDim)
const ScDPSaveNumGroupDimension * GetNumGroupDim(const OUString &rGroupDimName) const
OUString CreateDateGroupDimName(sal_Int32 nDatePart, const ScDPObject &rObject, bool bAllowSource, const ::std::vector< OUString > *pDeletedNames)
void AddGroupDimension(const ScDPSaveGroupDimension &rGroupDim)
ScDPSaveNumGroupDimension * GetNumGroupDimAcc(const OUString &rGroupDimName)
ScDPSaveGroupDimension * GetGroupDimAccForBase(const OUString &rBaseDimName)
const ScDPSaveGroupDimension * GetNextNamedGroupDim(const OUString &rGroupDimName) const
void RemoveGroupDimension(const OUString &rGroupDimName)
const ScRange & GetOutRange() const
void SetName(const OUString &rNew)
const ScDPServiceDesc * GetDPServiceDesc() const
void SetSaveData(const ScDPSaveData &rData)
void GetDrillDownData(const ScAddress &rPos, css::uno::Sequence< css::uno::Sequence< css::uno::Any > > &rTableData)
void SetImportDesc(const ScImportSourceDesc &rDesc)
css::uno::Reference< css::sheet::XDimensionsSupplier > const & GetSource()
void SetTag(const OUString &rNew)
void SetSheetDesc(const ScSheetSourceDesc &rDesc)
void SetServiceData(const ScDPServiceDesc &rDesc)
bool IsDimNameInUse(std::u16string_view rName) const
const ScSheetSourceDesc * GetSheetDesc() const
bool GetDataFieldPositionData(const ScAddress &rPos, css::uno::Sequence< css::sheet::DataPilotFieldFilter > &rFilters)
ScDPSaveData * GetSaveData() const
void SetOutRange(const ScRange &rRange)
const OUString & GetName() const
void GetPositionData(const ScAddress &rPos, css::sheet::DataPilotTablePositionData &rPosData)
const OUString & GetTag() const
OUString GetDimName(tools::Long nDim, bool &rIsDataLayout, sal_Int32 *pFlags=nullptr)
tools::Long GetDimCount()
const ScImportSourceDesc * GetImportSourceDesc() const
SC_DLLPUBLIC void SetIgnoreEmptyRows(bool bSet)
bool GetDrillDown() const
bool GetFilterButton() const
bool GetIgnoreEmptyRows() const
void SetPosition(ScDPSaveDimension *pDim, tools::Long nNew)
ScDPSaveDimension * DuplicateDimension(std::u16string_view rName)
bool GetRepeatIfEmpty() const
SC_DLLPUBLIC const std::optional< OUString > & GetGrandTotalName() const
SC_DLLPUBLIC void SetRepeatIfEmpty(bool bSet)
SC_DLLPUBLIC void SetFilterButton(bool bSet)
void RemoveDimensionByName(const OUString &rName)
bool GetColumnGrand() const
SC_DLLPUBLIC void SetGrandTotalName(const OUString &rName)
std::vector< std::unique_ptr< ScDPSaveDimension > > DimsType
SC_DLLPUBLIC void SetRowGrand(bool bSet)
SC_DLLPUBLIC void SetColumnGrand(bool bSet)
const DimsType & GetDimensions() const
const ScDPDimensionSaveData * GetExistingDimensionData() const
SC_DLLPUBLIC ScDPDimensionSaveData * GetDimensionData()
SC_DLLPUBLIC void SetDimensionData(const ScDPDimensionSaveData *pNew)
SC_DLLPUBLIC ScDPSaveDimension * GetDimensionByName(const OUString &rName)
Get a dimension object by its name.
SC_DLLPUBLIC void SetDrillDown(bool bSet)
const css::sheet::DataPilotFieldSortInfo * GetSortInfo() const
void SetLayoutName(const OUString &rName)
void SetOrientation(css::sheet::DataPilotFieldOrientation nNew)
css::sheet::DataPilotFieldOrientation GetOrientation() const
const css::sheet::DataPilotFieldLayoutInfo * GetLayoutInfo() const
const css::sheet::DataPilotFieldAutoShowInfo * GetAutoShowInfo() const
ScDPSaveMember * GetMemberByName(const OUString &rName)
Get a member object by its name.
void SetCurrentPage(const OUString *pPage)
const css::sheet::DataPilotFieldReference * GetReferenceValue() const
bool GetRepeatItemLabels() const
bool IsDataLayout() const
bool GetShowEmpty() const
void SetSubTotals(std::vector< ScGeneralFunction > &&rFuncs)
void SetMemberPosition(const OUString &rName, sal_Int32 nNewPos)
void SetFunction(ScGeneralFunction nNew)
Represents a new group dimension whose dimension ID is higher than the highest source dimension ID.
void AddGroupItem(const ScDPSaveGroupItem &rItem)
void RemoveFromGroups(const OUString &rItemName)
const OUString & GetSourceDimName() const
const OUString & GetGroupDimName() const
const ScDPNumGroupInfo & GetDateInfo() const
void SetDateInfo(const ScDPNumGroupInfo &rInfo, sal_Int32 nPart)
const ScDPSaveGroupItem * GetNamedGroup(const OUString &rGroupName) const
OUString CreateGroupName(std::u16string_view rPrefix)
tools::Long GetGroupCount() const
const ScDPSaveGroupItem & GetGroupByIndex(tools::Long nIndex) const
Classes to save Data Pilot settings that create new dimensions (fields).
void AddElementsFromGroup(const ScDPSaveGroupItem &rGroup)
size_t GetElementCount() const
void RemoveElementsFromGroups(ScDPSaveGroupDimension &rDimension) const
remove this group's elements from their groups in rDimension (rDimension must be a different dimensio...
const OUString & GetGroupName() const
void AddElement(const OUString &rName)
const OUString * GetElementByIndex(size_t nIndex) const
SC_DLLPUBLIC void SetIsVisible(bool bSet)
SC_DLLPUBLIC bool HasShowDetails() const
bool GetShowDetails() const
SC_DLLPUBLIC bool HasIsVisible() const
bool GetIsVisible() const
SC_DLLPUBLIC void SetShowDetails(bool bSet)
Represents a group dimension that introduces a new hierarchy for an existing dimension.
void SetDateInfo(const ScDPNumGroupInfo &rInfo, sal_Int32 nPart)
const ScDPNumGroupInfo & GetDateInfo() const
void SetGroupInfo(const ScDPNumGroupInfo &rNew)
const ScDPNumGroupInfo & GetInfo() const
static SC_DLLPUBLIC OUString getSourceDimensionName(std::u16string_view rName)
Base class of all implementation objects based on a DataPilot descriptor or DataPilot table object.
ScDPSaveDimension * GetDPDimension(ScDPObject **ppDPObject=nullptr) const
Returns the DataPilot dimension object related to the field described by maFieldId.
sal_Int32 GetMemberCount() const
Returns the number of members for the field described by maFieldId.
ScDPObject * GetDPObject() const
Returns the wrapped DataPilot object (calls GetDPObject() at parent).
css::uno::Reference< css::sheet::XMembersAccess > GetMembers() const
Returns the collection of members for the field described by maFieldId.
rtl::Reference< ScDataPilotDescriptorBase > mxParent
ScDocShell * GetDocShell() const
void SetDPObject(ScDPObject *pDPObject)
Sets the passed DataPilot object (calls SetDPObject() at parent).
ScFieldIdentifier maFieldId
ScDataPilotChildObjBase(ScDataPilotDescriptorBase &rParent)
virtual ~ScDataPilotChildObjBase()
static PivotFunc FunctionBit(sal_Int16 eFunc)
static void FillGroupInfo(css::sheet::DataPilotFieldGroupInfo &rInfo, const ScDPNumGroupInfo &rGroupInfo)
virtual void SAL_CALL setSourceRange(const css::table::CellRangeAddress &aSourceRange) override
virtual css::uno::Reference< css::sheet::XDataPilotField > SAL_CALL getDataLayoutField() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDataFields() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SetDPObject(ScDPObject *pDPObj)=0
virtual ~ScDataPilotDescriptorBase() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDocShell * GetDocShell() const
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getColumnFields() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDataPilotFields() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getHiddenFields() override
virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL getFilterDescriptor() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getPageFields() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getRowFields() override
SfxItemPropertySet maPropSet
virtual css::table::CellRangeAddress SAL_CALL getSourceRange() override
virtual ScDPObject * GetDPObject() const =0
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScDataPilotDescriptorBase(ScDocShell &rDocSh)
virtual ScDPObject * GetDPObject() const override
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL setName(const OUString &aName) override
virtual OUString SAL_CALL getTag() override
virtual void SAL_CALL setTag(const OUString &aTag) override
virtual void SetDPObject(ScDPObject *pDPObj) override
virtual ~ScDataPilotDescriptor() override
ScDataPilotDescriptor(ScDocShell &rDocSh)
std::unique_ptr< ScDPObject > mpDPObject
virtual ~ScDataPilotFieldGroupItemObj() override
ScDataPilotFieldGroupItemObj(ScDataPilotFieldGroupObj &rParent, OUString aName)
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL setName(const OUString &aName) override
rtl::Reference< ScDataPilotFieldGroupObj > mxParent
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual ~ScDataPilotFieldGroupObj() override
virtual void SAL_CALL removeByName(const OUString &Name) override
rtl::Reference< ScDataPilotFieldGroupsObj > mxParent
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual sal_Bool SAL_CALL hasElements() override
virtual sal_Int32 SAL_CALL getCount() override
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual void SAL_CALL setName(const OUString &aName) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
ScDataPilotFieldGroupObj(ScDataPilotFieldGroupsObj &rParent, OUString aGroupName)
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Implementation of all grouped items in a DataPilot field.
virtual sal_Int32 SAL_CALL getCount() override
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
virtual ~ScDataPilotFieldGroupsObj() override
void renameFieldGroup(const OUString &rOldName, const OUString &rNewName)
ScFieldGroups::iterator implFindByName(const OUString &rName)
virtual void SAL_CALL removeByName(const OUString &Name) override
ScDataPilotFieldGroupsObj(ScFieldGroups &&rGroups)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
ScFieldGroup & getFieldGroup(const OUString &rName)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Bool SAL_CALL hasElements() override
Implementation of a single DataPilot field.
void setSortInfo(const css::sheet::DataPilotFieldSortInfo *pInfo)
void setLayoutInfo(const css::sheet::DataPilotFieldLayoutInfo *pInfo)
css::sheet::DataPilotFieldGroupInfo getGroupInfo()
void setAutoShowInfo(const css::sheet::DataPilotFieldAutoShowInfo *pInfo)
virtual css::uno::Reference< css::sheet::XDataPilotField > SAL_CALL createDateGroup(const css::sheet::DataPilotFieldGroupInfo &rInfo) override
css::sheet::DataPilotFieldOrientation getOrientation() const
virtual void SAL_CALL setName(const OUString &aName) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
bool hasGroupInfo() const
void setCurrentPage(const OUString &sPage)
void setRepeatItemLabels(bool bShow)
void setReference(const css::sheet::DataPilotFieldReference *pInfo)
void setSubtotals(const std::vector< ScGeneralFunction > &rFunctions)
sal_Int16 getFunction() const
virtual css::uno::Reference< css::sheet::XDataPilotField > SAL_CALL createNameGroup(const css::uno::Sequence< OUString > &aItems) override
void setOrientation(css::sheet::DataPilotFieldOrientation Orientation)
SfxItemPropertySet maPropSet
const css::sheet::DataPilotFieldLayoutInfo * getLayoutInfo() const
css::uno::Reference< css::container::XIndexAccess > mxItems
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
const css::sheet::DataPilotFieldReference * getReference() const
void setGroupInfo(const css::sheet::DataPilotFieldGroupInfo *pInfo)
bool getRepeatItemLabels() const
void setShowEmpty(bool bShow)
void setFunction(ScGeneralFunction Function)
virtual OUString SAL_CALL getName() override
const css::sheet::DataPilotFieldAutoShowInfo * getAutoShowInfo() const
bool getShowEmpty() const
ScDataPilotFieldObj(ScDataPilotDescriptorBase &rParent, const ScFieldIdentifier &rIdent)
const css::sheet::DataPilotFieldSortInfo * getSortInfo() const
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getItems() override
void setUseCurrentPage(bool bUse)
virtual ~ScDataPilotFieldObj() override
css::uno::Sequence< sal_Int16 > getSubtotals() const
Collection of all DataPilot fields, or of all fields from a specific dimension.
virtual sal_Bool SAL_CALL hasElements() override
virtual ~ScDataPilotFieldsObj() override
rtl::Reference< ScDataPilotFieldObj > GetObjectByName_Impl(const OUString &rName) const
ScDataPilotFieldsObj(ScDataPilotDescriptorBase &rParent)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
rtl::Reference< ScDataPilotFieldObj > GetObjectByIndex_Impl(sal_Int32 nIndex) const
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual ~ScDataPilotItemObj() override
virtual OUString SAL_CALL getName() override
SfxItemPropertySet maPropSet
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL setName(const OUString &aName) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
ScDataPilotItemObj(ScDataPilotDescriptorBase &rParent, const ScFieldIdentifier &rFieldId, sal_Int32 nIndex)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual ~ScDataPilotItemsObj() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
ScDataPilotItemsObj(ScDataPilotDescriptorBase &rParent, const ScFieldIdentifier &rFieldId)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
ScDataPilotItemObj * GetObjectByIndex_Impl(sal_Int32 nIndex) const
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual ScDPObject * GetDPObject() const override
XModifyListenerArr_Impl aModifyListeners
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL insertDrillDownSheet(const css::table::CellAddress &aAddr) override
virtual css::sheet::DataPilotTablePositionData SAL_CALL getPositionData(const css::table::CellAddress &aAddr) override
virtual css::table::CellRangeAddress SAL_CALL getOutputRangeByType(sal_Int32 nType) override
virtual void SetDPObject(ScDPObject *pDPObj) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL release() noexcept override
virtual ~ScDataPilotTableObj() override
virtual void SAL_CALL setTag(const OUString &aTag) override
virtual OUString SAL_CALL getTag() override
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL setName(const OUString &aName) override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL refresh() override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDrillDownData(const css::table::CellAddress &aAddr) override
virtual css::table::CellRangeAddress SAL_CALL getOutputRange() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDataPilotTableObj(ScDocShell &rDocSh, SCTAB nT, OUString aN)
DataPilotTables collection per sheet.
virtual void SAL_CALL insertNewByName(const OUString &aName, const css::table::CellAddress &aOutputAddress, const css::uno::Reference< css::sheet::XDataPilotDescriptor > &xDescriptor) override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
rtl::Reference< ScDataPilotTableObj > GetObjectByName_Impl(const OUString &aName)
virtual ~ScDataPilotTablesObj() override
virtual void SAL_CALL removeByName(const OUString &aName) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDataPilotTablesObj(ScDocShell &rDocSh, SCTAB nT)
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Reference< css::sheet::XDataPilotDescriptor > SAL_CALL createDataPilotDescriptor() override
rtl::Reference< ScDataPilotTableObj > GetObjectByIndex_Impl(sal_Int32 nIndex)
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
void SetDocumentModified()
const ScDocument & GetDocument() const
ScTabViewShell * GetBestViewShell(bool bOnlyVisible=true)
void AddUnoObject(SfxListener &rObject)
void AddUnoListenerCall(const css::uno::Reference< css::util::XModifyListener > &rListener, const css::lang::EventObject &rEvent)
void RemoveUnoObject(SfxListener &rObject)
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
static void FillImportParam(ScImportParam &rParam, const css::uno::Sequence< css::beans::PropertyValue > &rSeq)
static void FillProperties(css::uno::Sequence< css::beans::PropertyValue > &rSeq, const ScImportParam &rParam)
static tools::Long GetPropertyCount()
bool UpdateReference(UpdateRefMode, const ScDocument *, const ScRange &rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz)
This class contains authoritative information on the internal reference used as the data source for d...
SC_DLLPUBLIC void SetSourceRange(const ScRange &rRange)
SC_DLLPUBLIC const ScRange & GetSourceRange() const
Get the range that contains the source data.
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
static void FillApiRange(css::table::CellRangeAddress &rApiRange, const ScRange &rScRange)
static bool GetBoolProperty(const css::uno::Reference< css::beans::XPropertySet > &xProp, const OUString &rName, bool bDefault=false)
static sal_Int16 GetInt16FromAny(const css::uno::Any &aAny)
static sal_Int32 GetEnumFromAny(const css::uno::Any &aAny)
const SfxItemPropertyMap & getPropertyMap() const
css::uno::Type const & get()
static sal_Int32 lcl_GetObjectIndex(ScDPObject *pDPObj, const ScFieldIdentifier &rFieldId)
static bool lcl_GetFieldDataByName(ScDPObject *pDPObj, const OUString &rFieldName, ScFieldIdentifier &rFieldId)
static bool lcl_IsDuplicated(const Reference< XPropertySet > &rDimProps)
constexpr OUStringLiteral SC_DATALAYOUT_NAME
static OUString lcl_CreatePivotName(ScDocShell *pDocShell)
static bool lcl_GetFieldDataByIndex(const Reference< XDimensionsSupplier > &rSource, const Any &rOrient, SCSIZE nIndex, ScFieldIdentifier &rFieldId)
static OUString lcl_GetOriginalName(const Reference< XNamed > &rDim)
static ScDPObject * lcl_GetDPObject(ScDocShell *pDocShell, SCTAB nTab, std::u16string_view rName)
static sal_Int32 lcl_GetFieldCount(const Reference< XDimensionsSupplier > &rSource, const Any &rOrient)
::std::vector< ScFieldGroup > ScFieldGroups
::std::vector< OUString > ScFieldGroupMembers
ScGeneralFunction
the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2,...
@ AVERAGE
average of all numerical values is calculated.
@ PRODUCT
product of all numerical values is calculated.
@ MAX
maximum value of all numerical values is calculated.
@ COUNT
all values, including non-numerical values, are counted.
@ VARP
variance is calculated based on the entire population.
@ SUM
sum of all numerical values is calculated.
@ STDEVP
standard deviation is calculated based on the entire population.
@ MEDIAN
median of all numerical values is calculated.
@ COUNTNUMS
numerical values are counted.
@ NONE
nothing is calculated.
@ MIN
minimum value of all numerical values is calculated.
@ VAR
variance is calculated based on a sample.
@ AUTO
function is determined automatically.
@ STDEV
standard deviation is calculated based on a sample.
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SC_QUERYINTERFACE(x)
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool any2bool(const css::uno::Any &rAny)
Any SAL_CALL getCaughtException()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
OUString ScResId(TranslateId aId)
ScFieldGroupMembers maMembers
bool mbDataLayout
Field index (if several fields with same name exist).
sal_Int32 mnFieldIdx
Source field name.
css::sheet::DataImportMode nType
constexpr OUStringLiteral SC_UNONAME_FUNCTION
constexpr OUStringLiteral SC_UNONAME_SHOWEMPTY
constexpr OUStringLiteral SC_UNONAME_ORIENT
constexpr OUStringLiteral SC_UNO_DP_IMPORTDESC
constexpr OUStringLiteral SC_UNO_DP_SHOWFILTER
constexpr OUStringLiteral SC_UNO_DP_COLGRAND
constexpr OUStringLiteral SC_UNO_DP_SOURCESERVICE
constexpr OUStringLiteral SC_UNONAME_REPEATITEMLABELS
constexpr OUStringLiteral SC_UNO_DP_REPEATEMPTY
constexpr OUStringLiteral SC_UNO_DP_ISDATALAYOUT
constexpr OUStringLiteral SC_UNO_DP_SERVICEARG
constexpr OUStringLiteral SC_UNONAME_HASSORTINFO
constexpr OUStringLiteral SC_UNONAME_AUTOSHOW
constexpr OUStringLiteral SC_UNONAME_SHOWDETAIL
constexpr OUStringLiteral SC_UNONAME_POS
constexpr OUStringLiteral SC_UNO_DP_DRILLDOWN
constexpr OUStringLiteral SC_UNONAME_HASLAYOUTINFO
constexpr OUStringLiteral SC_UNO_DP_SOURCENAME
constexpr OUStringLiteral SC_UNO_DP_GRANDTOTAL_NAME
constexpr OUStringLiteral SC_UNO_DP_ORIGINAL
constexpr OUStringLiteral SC_UNO_DP_IGNORE_EMPTYROWS
constexpr OUStringLiteral SC_UNONAME_SUBTOTALS
constexpr OUStringLiteral SC_UNONAME_NAME
constexpr OUStringLiteral SC_UNONAME_ISHIDDEN
constexpr OUStringLiteral SC_UNONAME_REFERENCE
constexpr OUStringLiteral SC_UNONAME_HASAUTOSHOW
constexpr OUStringLiteral SC_UNONAME_SELPAGE
constexpr OUStringLiteral SC_UNONAME_GROUPINFO
constexpr OUStringLiteral SC_UNO_DP_OBJECTNAME
constexpr OUStringLiteral SC_UNONAME_SUBTOTALS2
constexpr OUStringLiteral SC_UNO_DP_ROWGRAND
constexpr OUStringLiteral SC_UNONAME_LAYOUTINFO
constexpr OUStringLiteral SC_UNONAME_SORTINFO
constexpr OUStringLiteral SC_UNO_DP_ORIENTATION
constexpr OUStringLiteral SC_UNONAME_FUNCTION2
constexpr OUStringLiteral SC_UNO_DP_USERNAME
constexpr OUStringLiteral SC_UNONAME_HASREFERENCE
constexpr OUStringLiteral SC_UNO_DP_ISVISIBLE
constexpr OUStringLiteral SC_UNONAME_USESELPAGE
constexpr OUStringLiteral SC_UNONAME_ISGROUP
constexpr OUStringLiteral SC_UNO_DP_SHOWDETAILS
constexpr OUStringLiteral SC_UNO_DP_PASSWORD