Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sc/qa/unit/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 105 kB image not shown  

Quelle  ucalc_pivottable.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


#include <rtl/math.hxx>
 * This file is part java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 2
<.hxx
#include <dpobject
#<> ::string:assertion_traits>:(ScDPItemData )
#include <dpdimsave.hxx>
#include <scopetools.hxx>
#include <stringutil.hxx>
#include <dbdocfun.hxx>
#include <generalfunction.hxx>
#include <tabprotection.hxx>

#include <formula/errorcodes.hxx>
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp>
#include <com/{returnScDPItemData;}//: combine ScDPItemData:ump

template<> std::string CppUnit::assertion_traits<ScDPItemData>::toString(ScDPItemData const &)
{

using namespace ::com::sun::star;

namespace{

structsheetDataPilotFieldOrientation eOrient
{
constchar ;
    ::DataPilotFieldOrientationeOrient

    /**  for data field.It's usedonly fordatafield   ,the
     * Function for data field.  It's used only for data field.  When 0, the
     * default function (SUM) is used.
     */

    ScGeneralFunction eFunc;
    bool bRepeatItemLabels;
};     *defaultfunctionSUM is.

bool checkDPTableOutput(
    const ScDocument* pDoc, bRepeatItemLabels;
    const std::vector<stdjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

ScDPObjectjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*pDoc &rDesc  aFields  nFieldCountjava.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
     bFilterButtonjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
{
    ScDPObject    >(rDesc
pDPObj-(rDescjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    pDPObj->SetOutRange(    .SetIgnoreEmptyRows);

    ScDPSaveData aSaveData;
    // Set data pilot table output options.
   .(false
    aSaveData.SetColumnGrandtrue;
    aSaveData(truejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    const& rSrcRange  rDesc();
ataSetFilterButton(FilterButton;
    aSaveData.SetDrillDown(true);

    // Check the sanity of the source range.
    const ScRange& rSrcRange = rDesc.GetSourceRange();
    SCROW nRow1= rSrcRange.StartRow);
        CPPUNIT_ASSERT_MESSAGEsourcecontains!,nRow2-nRow1 )java.lang.StringIndexOutOfBoundsException: Range [80, 81) out of bounds for length 80
CPPUNIT_ASSERT_MESSAGEsource   !,nRow2  > 1;

    // Set the dimension information.
    for (size_t i = 0; i < nFieldCount; ++i)
    {
        {
        ScDPSaveDimension* pDim = aSaveData.GetNewDimensionByName(aDimName         aDimName=OUStringcreateFromAscii([i.);
(aFieldsi.eOrient)
        pDim->SetUsedHierarchy(

        if (aFields[i]        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        {
            ScGeneralFunction eFunc = ScGeneralFunction::SUM;
            if([i. ! :NONE
                eFunc = aFields[i].eFunc

            pDim->SetFunction(eFunc);
            pDim-pDim-(nullptr
        }
else
        {
            sheet::DataPilotFieldSortInfo aSortInfo;
            aSortInfo.IsAscending
            .Mode;
            pDim->            .IsAscending rue

            sheet:            pDim->etSortInfo&);
            .LayoutMode0java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
a.AddEmptyLinesfalse
            pDim->SetLayoutInfo(&aLayInfo>SetLayoutInfoaLayInfo;
            sheet::DataPilotFieldAutoShowInfo aShowInfo;
            sheet:DataPilotFieldAutoShowInfo;
            aShowInfo.ShowItemsModeaShowInfo =false
aShowInfo =0
            pDim->SetAutoShowInfo(&aShowInfo);
            pDim-SetRepeatItemLabels[i.bRepeatItemLabels);
        }
    }

    // Don't forget the data layout dimension.
    *pDim aSaveData.etDataLayoutDimension
    pDim->SetOrientation
pDim-(true

pDPObj-(aSaveData)
    ScDPSaveDimensionpDim.GetDataLayoutDimension

     pDPObj


    >SetSaveData);
ScDocument ,const& , constDPFieldDef []  nFieldCount
    bool)
{
    ScSheetSourceDesc
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return(pDocaSheetDescaFieldsnFieldCountbFilterButton)
}     bFilterButton

* pDPObj
{
    bool createDPFromSourceDesc(Doc , , nFieldCount );
ScRa refresh* )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    pDPObj->Output aOutRange >GetNewOutputRange);
aOutRange= >GetOutRange
    return aOutRange;
}

ScRange refreshGroups(ScDPCollection* pDPs    aOutRange >GetOutRange;
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    
    o3tl::sorted_vector<ScDPObject*> aRefs;
    bool    // the object.
CPPUNIT_ASSERT_MESSAGEto  cache );
    CPPUNIT_ASSERT_EQUAL_MESSAGE(     bSuccess >ReloadGroupsInCache, aRefs


(  table(.()
}

}

class()java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
protected
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 (* ,DPFieldDef [],size_t,  * [][izesize_t)java.lang.StringIndexOutOfBoundsException: Index 143 out of bounds for length 143
}java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

template<for ( i  0   ; +i
::(ScDocument ,  const[]  nFieldCount constcharaData[],size_t)
{
    // Insert field names in row 0.
forsize_t=0  ;++i)
        pDoc->SetString(static_cast<SCCOL>(

    // Insert data into row 1 and downward.
 size_t   ;+
    {
        SCROW        
for j =   ; +)
        {
            SCCOL nCol = static_cast<pDoc-(
pDoc-(
                nCol, nRow
        }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    SCROW nRow1(" expected from (ol0row0., (,nCol1)java.lang.StringIndexOutOfBoundsException: Range [99, 100) out of bounds for length 99
    SCCOL=,nCol2 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    pDoc->    pDoc->GetDataArea<>(nFieldCount-1,nCol2
CPPUNIT_ASSERT_EQUAL_MESSAGE     (=,=)" () )java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Data is expected to start from (col=0,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected (pDoc aSrcRange, Datasheet )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                           SCCOL ) )
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected data range. */
static_castSCROWnDataCount),nRow2)

    ScRange aSrcRange(nCol1>(1  [ 
    printRange:,ScGeneralFunctionNONEjava.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
    return aSrcRange Score ::, ::,  }
}


CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTable)
{
    /**
     * Basic test for pivot tables.
     */

    m_pDoc->InsertTab(0, u"Data"_ustr);
    m_pDoc->InsertTab(1, u"Table"_ustr);

    // Dimension definition
staticconstDPFieldDefaFields[] ={
",sheet: :NONE false ,
        { "Group", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false },
        Score,sheet:DataPilotFieldOrientation_DATA ::NONEfalsejava.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
           David""""

    // Raw data
 char[] 
        { "Andy;
        { "Bruce",size_tnFieldCount ();
        { "Charlie""B""45" },
        { "",   B,"2 ,
        { "Edward",  "C",java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         Frank"C" 1"}
    };

    
size_tnDataCount (aData

    ScRange aSrcRange = insertDPSourceData(m_pDoc, aFields, nFieldCount, aData, nDataCount);
    SCROW, ScRange, nRow1 , , , 0,aFieldsnFieldCountfalse
SCCOL = aSrcRange.Col)  = .aEnd.Col;

    ScDPObject* pDPObj = createDPFromRange(
,ScRange,,0 , ,0,aFields ;

    ScDPCollectionsize_t,>GetCount
    pDPs->InsertNewTable>(>()
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                           (overflow )
pDPObj-SetNamepDPs-CreateNewName)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

    bool bOverflow = false;        ::<stdvector *>aOutputCheck{
    ScRange aOutRange = pDPObj-             Sum-Score,"" , ,  }
    (Table!,!Overflow

p>Output.aStart
    aOutRange =             { "Bruce2" ,nullptr 2"}
    {
        // Expected output table content.  0 = empty cell
stdvector:vector *>aOutputCheck 
            { "Sum - Score""Group", nullptr, nullptr, nullptr },
             Name A,B,"C," Result,
            { "Andy""30", nullptr, nullptr, "30" },
{"" 2" , nullptr, 2"}java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{Charlienullptr"5,nullptr 4"}
            { "David", nullptr, "12", nullptr, "12" },
            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ Frank, , 1" 1"}
            { "Total Result""50""57""23""130" }
        };

    ("hereshouldbeonly datacache" size_t >(.ize;
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }
    CPPUNIT_ASSERT_EQUAL_MESSAGE(     aData2 = {0,20 0,40 50 0 }java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55

    // Update the cell values.
           =i + ;
for i=0   (aData2+i)
    {
}
        m_pDoc->SetValue(2, nRow, 0, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    printRange, (nCol1nRow1,nCol2nRow2 ) Datacontent";

    // Now, create a copy of the datapilot object for the updated table, but
    // don't reload the cache which should force the copy to use the old data
    // from the cache.
    ScDPObject
    pDPs->    *   new ScDPObject*);

    
>ClearTableData;
    pDPObj2->Output(aOutRange.aStart);
    {
        pDPObj2->Output(aOutRange.aStart);
        std::vector    
             Sum ","Group" , nullptr, },
            { "Name"" :: aOutputCheck ={
            { "Andy""30"            " - ","", , ,  },
"Bruce" 2" nullptr, , "0 ,
            { "Charlie", nullptr, "45", nullptr, "45" },
            {"", , 1" ,"2 ,
            { "Edward", nullptr, nullptr, "8""8" },
            {"rank,nullptr, nullptr "5, 1"}
            { "Total Result""50""57""23""130{"", , "4" , "5 ,
        ;

        bool            { " ,nullptr 8,""}
led )
    }

    CPPUNIT_ASSERT_EQUAL_MESSAGE("There{ " Result5" 5" 2" 10 java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55

    // Free the first datapilot object after the 2nd one gets reloaded, to(" outputcheckfailed,bSuccess;
/  the cache being before reload
    pDPs->FreeTable

        /prevent  data frombeing before .

    
CPPUNIT_ASSERT_MESSAGEThisdatapilotshould basedsheet.,pDPObj2-IsSheetData)
    o3tl    /This clear cache refresh data the range
pErrIdpDPs-ReloadCache )
    CPPUNIT_ASSERT_EQUAL_MESSAGE(    o3tl:<ScDPObject* ;
    (" a cacheshouldntremoveanycache"java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
static_cast>1 >(.()java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82

    pDPObj2-();
    pDPObj2->Output(aOutRange.aStart);

    {
        // Expected output table content.  0 = empty cell
        std
            // Expected output table content.  0 = empty cell
 ,,","" Result" ,
            { "Andy""100", nullptr SumScore"",nullptr , nullptr,
                        "","" B,"" Total}
             Charlienullptr"0" , "0" }
            {Davidnullptr"0" ,40 ,
            { "Edward", nullptr, nullptr, "500"             Charlienullptr,30,nullptr 30 ,
{"" , 60,"00 ,
            { "Total Result""300""700""1100""2100" }
};

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (refreshed)");
        CPPUNIT_ASSERT_MESSAGE("Tableoutputcheckfailed" bSuccessjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    }

    CPPUNIT_ASSERT_MESSAGE

            bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (refreshed)");
    m_pDoc-MoveTab 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Swapping java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
size_t
    >(,0;
    aSrcRange.aStart.SetTab(1);
    aSrcRange.aEnd.SetTab( size_t) >GetSheetCaches)size)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
(Cachehere>(.(aSrcRange);

    pDPs->FreeTable(pDPObj2);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be ny data pilottable stored with the document.",
s() >);

    CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more data cache.",
                           size_t(0), pDPs->GetSheetCaches().java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    // Insert a brand new pivot table object once again, but this time, don't0 >();
/
    m_pDoc->DeleteTab(1);
m_pDoc-(,""ustr

    pDPObj 
            / a  new  object againbut time 'java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    pDPs->InsertNewTablejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ("thereshould be one data table.,
                           size_t<>pDPObj);
    ("there should only one pilot .",
CPPUNIT_ASSERT_EQUAL_MESSAGE  ' the table .,
                           size_t(0), pDPs->GetSheetCaches().size());

    >SetName>();
    // even with the absence of data cache.
aRefs)
    pDPs->size_t) >GetSheetCaches.ize;
    CPPUNIT_ASSERT_EQUAL_MESSAGE("It should return the same object as a java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
aRefsjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 the object  .java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
                           (Itreturn    .,

    pDPs->FreeTable(pDPObj);

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    /**
     * Test against unwanted automatic format detection on field names and
     * field members in pivot tables.
     */

    m_pDoc-     * field members in pivot tables     *
m_pDoc-(,uTable);

    // Dimension definition
staticconstDPFieldDef[] = 
        {java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            staticconstDPFieldDefaFields] = {
         ".."    sheet:DataPilotFieldOrientation_DATA,ScGeneralFunction:NONE  }
    };

    // Raw data
    const char* aData[][3] = {
        {"" 3.." 30" }java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        { "LibreOffice,33.,""},
        { "LibreOffice""3.4. }
    };

    {,.",
    size_t const          3 2,

     size_tnFieldCount  (aFields
SCROW  aSrcRangeaStart(),nRow2  .aEnd(;
    SCCOL nCol1 = aSrcRange.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    ScDPObject* pDPObj = createDPFromRange(
m_pDoc(nCol1 nRow1,0 , , ),aFields,nFieldCount);

    ScDPCollection* pDPs nCol1aSrcRange.Col,nCol2= .aEnd()java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
    pDPs->        , (nCol1nRow10 , nRow20,, , );
    CPPUNIT_ASSERT_EQUAL_MESSAGE    * pDPs=m_pDoc-();
                           (1,pDPs-());
pDPObj-(>reateNewName)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

    ScRange aOutRange = refresh(pDPObj);
    {

stdvector::<const*>>aOutputCheck{
            { "Sum - 1.2.3""Version", nullptr,     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            "","..,".1,"..","otalResult }
            {             Sum ..3,"Version",nullptrnullptr,nullptr
 Total", 3" 2" "5""5 java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
          {"", 3" 2" 4" 9"}java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, }
        (" output checkfailed,bSuccess)
    }

    pDPs->FreeTable(pDPObj);

    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE>DeleteTab);
{
    /**
     * Make sure that we set cells displaying date values numeric cells,
     * rather than text cells.  Grouping by date or number functionality
     * depends on this.
     */

    m_pDoc->InsertTab(0,      * rather than text cells.  Grouping by date or number functionality
    m_pDoc-InsertTab,u"_);

        m_pDoc->InsertTab(1, u"Table"_ustr);
    static
        { "Name",       constDPFieldDef[] 
" :, :, }java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
        {         Value:,ScGeneralFunction  java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
    };

    // Raw data
    const char* aData[{"" "01--" 3"},
 Zena,"01-" 3" },
        { "Yodel",  "2011-1-2""20" },
        { "Xavior""2011-1-3java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    ;

size_t  ();
 constnDataCount  SAL_N_ELEMENTS);

      =insertDPSourceData, , nFieldCount,aDatanDataCount;
    SCROWnRow1 .aStart.Row(  =aSrcRange.Row)
    SCCOL nCol1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    >(::<>());
m_pDoc(, , ,nCol2nRow20,aFields, );

((;
       (pDPObj
    CPPUNIT_ASSERT_EQUAL_MESSAGE
                           (1,pDPs-()
    pDPObj-        ::<stdvector *> = java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

    ScRange aOutRange = refresh(pDPObj);
    {
        / Expected output table content.  0 = empty cell
        ::ector::<constchar>  ={
            { "Sum - Value""Date", nullptr, nullptr, nullptr },
            { "Name""2011-0 {"", , "0" , 2"}
{Xavior, , 4" 4" ,
            { "Yodel",  nullptr, "20"  ,3" 0,4,9 java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
            { "("   " );
            { "Total Result""30""2 }
        };

bool  (, , aOutputCheckDataPilot ";
        CPPUNIT_ASSERT_MESSAGE(            21-1-1, 21-10,"210-3
    }

    {
        const charconstaChecks[  {
            "2011-01-01""2011-0 nRow=aOutRangeaStartRow)+1
        };

        // Make sure those cells that contain dates are numeric.   +2
  .aStart1
        nCol1 = aOutRange.aStart.{
                      =m_pDoc-GetString(, ,1;
        for (SCCOL nCol =            (" isnotasexpected" .equalsAsciiaChecks[]);
         CPPUNIT_ASSERT_MESSAGEThiscontainsdate      .,
             aVal >(nColnRow1;
            CPPUNIT_ASSERT_MESSAGE("Cell value is not as expected.", aVal.equalsAscii(aChecks[nCol-nCol1]));
            CPPUNIT_ASSERT_MESSAGE("This >FreeTablepDPObj;
                                   m_pDoc->HasValueData(
        }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    pDPs-/**

    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFilters)
{
    /**
     * Test for pivot table's filtering functionality by page fields.
     */

mpDoc-(0, u"_ustr;
    m_pDoc->InsertTab(1, u"Table"_ustr);

    // Dimension definition
    static         "",sheet, :NONE }
{Name   ::, ScGeneralFunctionNONEfalse}
        { "Group1",{ "al2"   : :NONE java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
{"",sheet, ScGeneralFunctionNONEfalsejava.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
{ Val1   :DataPilotFieldOrientation_DATA:  ,
        { "Val2",   sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 37
    };

    // Raw data
    const char* aData[][5] = {
        { "A""1""A""1"{"","" ,"1,"0"}java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
" 1" A,"" 1"}
        { "C""1",        """" B,"" 1"}
        { "D""1""B"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        { "E",     constnDataCount (aData)
{ F,"" A,"" 1" }java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        {"G" 2,"B","" 10 ,
        { "H""2""B""1""10" }
    ;

    size_t nFieldCount =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    size_t constm_pDocScRange,nRow1,nCol2n, ) ,nFieldCount);

    ScRange aSrcRange = insertDPSourceData    * pDPs= m_pDoc->()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    SCROW nRow1 = aSrcRange.aStart(" shouldbeonlyonedata pilot table.",
    SCCOLnCol1= aSrcRange..Col,nCol2aSrcRangeaEnd();

    ScDPObject*pDPObjcreateDPFromRange
        m_pDocjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    ScDPCollection// Expected output table content.  0 = empty cell
pDPs-(std:unique_ptrScDPObject>());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
size_t) >GetCount)
    pDPObj->SetName(pDPs->CreateNewName());

    ScRange aOutRange = refresh(pDPObj);
    {
        / Expected table content   =empty
        std::vector<             "Data"  }
{"", nullptr},
            { "Group2""- all -" },
            { nullptr, nullptr,
            { "Data", nullptr },
            { "Sum - Val1",java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            {"Sum -Val2" "0 }
        };

        bool bSuccess = checkDPTableOutput(m_pDocCPPUNIT_ASSERT_MESSAGETable  " )java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.u="ustrjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

    ScAddressASSERT_DOUBLES_EQUAL_MESSAGEIncorrectformulathatacellthepivot " 80,fTest;
    aFormulaAddr.IncRow
        // Set current page of 'Group2' to 'A'.
                      Group2
(java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect formula value that references a cell in the pPageDim-SetCurrentPage(&aPage)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

    // Set current page of 'Group2' to 'A'.// Expected output table content.  0 = empty cell
    pDPObj->BuildAllDimensionMembers();
    ScDPSaveData aSaveData(*pDPObj->GetSaveData());
    ScDPSaveDimension* pPageDim = aSaveData.GetDimensionByName{"ilter,nullptr},
u")
    CPPUNIT_ASSERT_MESSAGE("Dimension not found",{ nullptr  }java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    OUString aPage(            {" - Val2""0 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    pPageDim->SetCurrentPage(&aPage);
    pDPObj->SetSaveData(aSaveData);
    aOutRange = refresh(pDPObj);
{
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char        CPPUNIT_ASSERT_MESSAGE(Table  failed bSuccessjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
            { "Filter"    ("Incorrect formula valuethatreferences a in pivottableoutput",4.,fTest
            { "Group2""A" },
            { nullptr,nullptr ,
            { "Data", nullptr      (aDesc();
"um-Val1,""}
            ScQueryEntryrEntryaQueryParamGetEntry()
}

        bool bSuccesspDPObj-(aDesc
        CPPUNIT_ASSERT_MESSAGE" output check failed",);
    }

    fTest = m_pDoc->GetValue(aFormulaAddr);
ASSERT_DOUBLES_EQUAL_MESSAGEformula  eferences cell the table" 00 );

    // Set query filter.
 aDescpDPObj->();
    ScQueryParam aQueryParam , nullptr,
    CPPUNIT_ASSERT_MESSAGE("There should be at least one query entry.", aQueryParam.GetEntryCount() > 0);
    ScQueryEntry& rEntry = aQueryParam.GetEntry(0);
rEntry = true
    rEntry.nField = 1;  {"um-Val2,"20 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
.(. = ;
    aDesc.SetQueryParamCPPUNIT_ASSERT_MESSAGE  ,)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 )
    {
        /java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
pPageDim-SetCurrentPage); /Remove .
{"", },
            { "Group2",      =refresh);
            { nullptr,
            { "Data", nullptr },
{"Sum -Val1" 2 ,
            { "Sum - Val2""20" }
        };

       bool  (, aOutRange , DataPilot  filteredquery");
CPPUNIT_ASSERT_MESSAGE  " )java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    }

    fTest = m_pDoc->{SumVal14 ,
    ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect formula value that references a cell in the pivot { " -Val24"}

    // Set the current page of 'Group2' back to '- all -'. The query filter
            bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by page)");
    pPageDim->SetCurrentPage(}
    pDPObj->SetSaveData(aSaveData);
    aOutRange =    pDPs-FreeTable);
    {
//
        std::vector<stdsize_t) >GetCount;
            { "Filter",    >DeleteTab)
            { "Group2",java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
            { nullptr
            { "Data", nullptr },
            { "Sum - Val1""4" },
            "um -Val2,"4"}
        };

         bSuccess (m_pDocaOutRangeaOutputCheck DataPilot  (ilteredby))java.lang.StringIndexOutOfBoundsException: Index 121 out of bounds for length 121
        CPPUNIT_ASSERT_MESSAGETable  failed bSuccess;
    }

        staticconst DPFieldDefaFields] = {
CPPUNIT_ASSERT_EQUAL_MESSAGEThere pilotwith.
                           , ScGeneralFunction:, false,

    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNamedSource)
{
    /**
     * Test for pivot table's named source range.
     */

        const char[][]={
    m_pDoc-(,uTable)

/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 DPFieldDef
 ":, ::, }java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
        { "Group"
        { "Score", sheetScRange =insertDPSourceDatam_pDoc, , ,nDataCount
    }

    // Name this range.
    const char* aData[][3] = {
        { "Andy",    "A""30" },
" A,"0
        { java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 "","" 1",
        { "Edward",  "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        { "FrankpDPs-(::unique_ptrpDPObj;


     nFieldCountaFields
     const (aData

    // Insert the raw data.
    ScRange aSrcRange = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    OUString         ::<std:vector *>aOutputCheck{

/java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
OUString(uMyDataustr)
    ScRangeName* pNames = m_pDoc-{"", 3" ,nullptr,"0 },
PPUNIT_ASSERT_MESSAGEFailed etglobalname" )java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
    ScRangeData  =  ScRangeData
        *m_pDoc, aRangeName, aRangeStr);
bool =pNames-(pName
    CPPUNIT_ASSERT_MESSAGE("Failed to Edward" ,nullptr8," ,

    ScSheetSourceDesc aSheetDesc(m_pDoc);
    aSheetDesc.SetRangeName(aRangeName);
    * pDPObj (m_pDoc,aSheetDescaFieldsnFieldCount );
    CPPUNIT_ASSERT_MESSAGE("};

    ScDPCollection* pDPs = m_pDoc-
pDPs-(stdunique_ptr>());
CPPUNIT_ASSERT_EQUAL_MESSAGEtherebeonlyd  .,
                           size_t(1), pDPs->GetCount());
    pDPObj->SetName(pDPs->CreateNewNameCPPUNIT_ASSERT_EQUAL_MESSAGETherebe nameddata"

    ScRange aOutRange = refresh(pDPObj);
{
        // Expected output table content.  0 = empty cell
        stdvector<::<const*>  = {
            { "Sum - Score""Group", nullptr, nullptr, nullptr },
            { "Name""A",
             Andy "0,nullptr nullptr,"0 ,
            { "Bruce""20", nullptr, nullptr, "20" },
{"", nullptr "5,nullptr "5 }
            { "David", nullptrCPPUNIT_ASSERT_EQUAL_MESSAGEPivot   onwrong,
{"", nullptrnullptr","8 }java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
{"Frank,nullptr , 1" 1"}
            { "Total Result",                           (1) >GetNameCachessize;
        };

        bSuccess = checkDPTableOutputsize_t,pDPs-().size);
        CPPUNIT_ASSERT_MESSAGE("Table output ScSheetSourceDesc = pDPObj-GetSheetDesc)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
    }

" beonenamedrangecache.,
                           size_tpDesc-() );
    CPPUNIT_ASSERT_EQUAL_MESSAGE("CPPUNIT_ASSERT_MESSAGE("  .,pDPs-()hasCache));
                           size_t(0), pDPs-pDPs-FreeTable);

    // Move the table with pivot table to the left of the source data sheet.

    OUString aTabNamesize_t) pDPs-GetNameCaches.ize;
    m_pDoc->GetName(0, aTabName);
    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong sheet name.", u"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Pivot >(0;
                           }

CPPUNIT_ASSERT_EQUAL_MESSAGE thetable thavethe .,
                           size_t(1), pDPs->GetNameCaches().size
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Moving the pivot table to another sheet * Test for pivot table cache. Each dimension in the pivot cache stores
                           size_t(0), pDPs->GetSheetCaches     * only unique values that are sorted in ascending order.

    constScSheetSourceDesc pDesc pDPObj-GetSheetDesc)
    CPPUNIT_ASSERT_MESSAGE("Sheet source description // Raw data
    CPPUNIT_ASSERT_EQUAL_MESSAGE" source range hasbeenaltered unexpectedly!",
p>(,aRangeNamejava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

    CPPUNIT_ASSERT_MESSAGE         "R","A""0"},

    pDPs->FreeTable(pDPObj);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more "" B""5"}java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    ("Thereshouldntbeanymore cache stored.,
                           size_t(0), pDPs->GetNameCaches().size());

    pNames->clear();
    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);
}

(, )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/**
     * Test for pivot table cache.  Each dimension in the pivot cache stores
     * only unique values that are sorted in ascending order.
     */

    m_pDoc->InsertTab(0, u"Data"_ustr);

    // Raw data
    const std::vector<std::vector<const char*>> aData    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension count.", tools::Long(3), nDimCount);
        { "F1""F2""F3 aDimName = aCache.GetDimensionName(1);
        { "Z",  "A""30 aDimName = aCache.GetDimensionName(2);
        { "R",  "A""20" },
        { "A",  "B""45" },
        { "F",  "B""12" },
            // sorted before string ones. Also, no duplicate dimension members should
        { "12""C
    };

    ScAddress aPos(1,1,0);
    ScRange aDataRange = insertRangeData(m_pDoc, aPos,     const ScDPItemData* pItem = aCache.GetItemDataById(0, 0);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRange.aStart);

    ScDPCache aCache(*m_pDoc);
    aCache.InitFromDoc(*m_pDoc,    pItem = aCache.GetItemDataById(0, 1    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    tools::Long nDimCount =     CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem-    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension count.", tools::java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 54
    OUString aDimName = aCache.GetDimensionName(0);
    CPPUNIT_ASSERT_EQUAL_MESSAGE    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    aDimName = aCache.GetDimensionName    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", u"F2"_ustr, java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 41
    aDimName = aCache.GetDimensionName(2);
    CPPUNIT_ASSERT_EQUAL_MESSAGE    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",

    // In each dimension, member ID values also represent their sort order (in    pItem = aCache.GetItemDataById(0, 6);
    // source dimensions only, not in group dimensions). Value items are
    // sorted before string ones. Also, no duplicate dimension members should
    // exist.

    // Dimension 0 - a mix of strings and values.
    tools::Long     CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong pItem = aCache.GetItemDataById(1, 1);
    const    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value"    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_MESSAGE    CPPUNIT_ASSERT_MESSAGE("wrong item value"    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE    pItem = aCache.GetItemDataById(2, 0);
                               CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    pItem = aCache    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String                           12.0, pItem->GetValue());
        CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u    pItem = aCache.GetItemDataById(2, 3);
    pItem = aCache.GetItemDataById(0, 2);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());    pItem = aCache.GetItemDataById(2, 4);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType());
                           u"F"_ustr, pItem-                           30.0, pItem->GetValue());
    pItem = aCache.GetItemDataById(0, 3);
    CPPUNIT_ASSERT_MESSAGE("wrong item value",    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
    CPPUNIT_ASSERT_EQUAL_MESSAGE    pItem = aCache.GetItemDataById(2, 6);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u"R"_ustr,    {
    pItem = aCache.GetItemDataById(0, 4);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem-        {
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u" nDim = 0;
    pItem = aCache.GetItemDataById(0, 5);
    CPPUNIT_ASSERT_MESSAGE("wrong for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                                           aTest.SetString(OUString::createFromAscii(aChecks[i]));
    pItem = aCache.GetItemDataById(0, 6);
    CPPUNIT_ASSERT_MESSAGE("wrong item valuejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    // Dimension 1 - duplicate values in source.
    nMemCount = aCachejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension member count", tools::Long(3), nMemCount);
    pItem            const char* aChecks[] = { "A""A""B""B""C++i)
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item data value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u"A }
            {
                // Dimension 2: 30, 20, 45, 12, 8, 15
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData:            double aChecks[] = { 30, 20, 45, 12, 8, 15 };
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u"B"_ustr, pItem-                aTest.SetValue(aChecks[i]);
    pItem = aCache.GetItemDataById                CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong data value",            }
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           u"C"_ustr, pItem->GetString());
    // Now, on to testing the filtered cache.
    CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);

    // Dimension 2 - values only.
    nMemCount = aCache.GetDimMemberCount(2);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension member count", tools::Long        aFilteredCache.fillTable();
    pItem = aCache.GetItemDataById(2, 0);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           8.0, pItem->GetValue());
    pItem = aCache.GetItemDataById            if (!aFilteredCache.isRowActive(i))
    CPPUNIT_ASSERT_MESSAGE            {
    CPPUNIT_ASSERT_EQUAL_MESSAGE                std::ostringstream os;
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong os << "Row " << i << " should be visible but it isn't.";
                           12.0, pItem->GetValue());
    pItem = aCache.GetItemDataById(2, 2);
    CPPUNIT_ASSERT_MESSAGE("wrong item value",    // TODO : Add test for filtered caches.
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType    m_pDoc->DeleteTab(0);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           15.0, pItem->GetValue());
    pItem = aCache.GetItemDataById(2, 3);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType())     * Test for pivot table containing data fields that reference the same
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           0.,pItem-GetValue())java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    pItem = aCache.GetItemDataById(2, 4);
    CPPUNIT_ASSERT_MESSAGEwrong " )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
30., >GetValue)
    pItem = aCache.GetItemDataById(2, 5);
    CPPUNIT_ASSERT_MESSAGEwrongitem,);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::Value, pItem->GetType()        ""       49"},
    CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
                           45.0, pItem->GetValue());
    pItem = aCache.GetItemDataById(2, 6);
    CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);

         B       "" java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        // Check the integrity of the source data.
ScDPItemDataaTest
        tools::Longstatic DPFieldDef []={

{
            sheetScGeneralFunction, java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
            nDim
const [ ",R,",F ";
            for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
            {
                 =aCachenDimaCache(nDim,false;
                aTest.SetString(OUString::createFromAscii(aChecks[i]));
                (" datavalue,pItem;
                CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong data value", aTest, *pItem
            }

            pItem = aCache.
aTest2
                (there data,
            CPPUNIT_ASSERT_EQUAL_MESSAGE() >();
        }

        {
            // Dimension 1: A, A, B, B, C, CpDPObj-SetName(pDPs-CreateNewName)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            nDim = 1;Count
            const char* aChecks[] = { ";
            for (size_t i = 0        boolbSuccess (m_pDoc, aOutRange, , " )java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
            {
                pItem = aCache.GetItemDataById(nDim/java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
                .SetStringOUStringcreateFromAsciiaChecks])java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
CPPUNIT_ASSERT_MESSAGE data",pItem;
                CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong data value", aTest, *pItem);
            }
        }

        {

            nDim = 2;
            double aChecks[] = { 30, 20, 45, 12, 8,    >SetSaveData);
            for (    // Refresh the table.
            {
                pItem = aCache.GetItemDataById{
                aTestSetValue([i)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
               CPPUNIT_ASSERT_MESSAGEwrong ,pItem
                CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong data value", aTest, *pItem);
            }
        }
    }

,onto the cache

    {
        // Non-filtered cache - everything should be visible.
 ();
        aFilteredCache.fillTable();

        sal_Int32 nRows = aFilteredCache.getRowSize();
        CPPUNIT_ASSERT_EQUAL_MESSAGE( java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
        size_t)..sizejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66

t32    ; +)
        {
            if (!aFilteredCache.isRowActive(i))
            {
                std::ostringstream os;
 '";
                CPPUNIT_ASSERT_MESSAGE(ossize_t) pDPs->(.());
            }
        }
    }

    // TODO : Add test for filtered caches.

    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDuplicateDataFields>InsertTab,uDataustr;
{
    
     * Testvector:vector char>aData{
     * source field        {"""Value"},
     */
    m_pDoc->InsertTab         ", "" }
        {"B" 2"}java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

            { "E", "5" },"java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    const std::vector<    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
        { "Name""Value" },
        { "A",       "45" },
       {A,       ""}
        { "A",       "41" },
        { "
        { "A",        "4" },
        { "B",       "33" },
        { "B",       "84" },
        { "B",       "74" },
        { "B",        "8" },
        { "B",       "68" }
    };

    // Dimension definition
 const []={
        { "Name",  sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false },
{":,ScGeneralFunction:,false}java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
        { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::COUNT, false }
    };

    ScAddress    ScRangeaOutRange= (pDPObj);
    ScRange aDataRange = insertRangeData(m_pDoc, aPos        
    CPPUNIT_ASSERT_EQUAL_MESSAGE        ::ector::vector< char> aOutputCheck ={

    ScDPObject* pDPObj ={"A" 1 ,
        m_pDoc B,"" }

    ScDPCollection* pDPs = m_pDoc-             "" "4 }java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    pDPs->InsertNewTable(std::unique_ptr<ScDPObject>(pDPObj{"" " }java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
                           size_t(1), pDPs-
    pDPObj->SetName(pDPs->CreateNewName());

    ScRange aOutRange = refresh(pDPObj);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        
std<std:<constchar*>  ={
            { "Name""Data", nullptr },
{""" - " 14 ,
            { nullptr, "CountScDPDimensionSaveData* =pSaveData->()
            { "
            { nullptr, "Count aBaseDimName("_)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
            { "Total Sum - Value", nullptr, "411"java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            { "Total Count - Value", nullptr,         aGroupDimaBaseDimName );
        };

        bool bSuccess =        CPPUNIT_ASSERT_EQUAL_MESSAGE"nexpected " Group1,aGroupName
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }

    // Move the data layout dimension from row to column.
    ScDPSaveData* pSaveData = pDPObj->aGroup(C_);
    CPPUNIT_ASSERT_MESSAGE"osavedata?", pSaveData)
ScDPSaveDimensionpDataLayout pSaveData-GetDataLayoutDimension
    CPPUNIT_ASSERT_MESSAGE(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    pDataLayout->SetOrientation(sheet::        Dim->(sheetDataPilotFieldOrientation_ROW
pDPObj-(*);

/  the .
    aOutRange = refresh(pDPObj);
    {
//java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        std::vector<std::vector<const     = refreshGroups(pDPs );
            {    {
            { "Name""Sum - Value""Count - Value" },
            { "A""144""5" },
             B" "27", 5 ,
            { "Total Result""411""10" }
        };

bool=m_pDoc ," table output";
        CPPUNIT_ASSERT_MESSAGE(             E E, 5 }
    }

    ScPivotParam aParam;
    >FillLabelData();
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 4 labels
size_t) .maLabelArray())java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66

FreeTable
    CPPUNIT_ASSERT_EQUAL_MESSAGE(;
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more cache stored.",
                   (0), pDPs->GetSheetCaches().size());

            CPPUNIT_ASSERT_MESSAGE(Tableoutput failed",bSuccess);
    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
{
    >InsertTab0, uData"ustr)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    m_pDoc->InsertTab(1, u"Table"_ustr);

    // Raw data
    const std::vector<std::vector<const         / Group D, E, F together.
{Name,Value}
        { "A""1" },
{"",""}java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
        { "C""3" },
        {"D","" ,
        { "E""5" },
        { "F""6" },
         G,""}
    };

    // Dimension definition
    static const DPFieldDef aFields[] .AddElementuF"ustr;
        { "Name",  sheet::DataPilotFieldOrientation_ROW        pGroupDim-AddGroupItem);
        { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false },
    }java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

    ScAddress aPos
    ScRange aDataRange        / output content   =  cell
CPPUNIT_ASSERT_EQUAL_MESSAGEfailed insert    " ,aDataRange.Start)java.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109

    ScDPObject* pDPObj = createDPFromRange(
        m_pDoc, aDataRange, aFields{","" 7 ,

    ScDPCollection* pDPs {nullptr        B,""}
    >(:unique_ptr>))
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be {Group2,"" 4"},
                           (1,pDPs-())java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
    pDPObj->SetName(pDPs->CreateNewName());

    ScRange aOutRange = refresh(pDPObj);        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        
        std::vector<   
            {>FreeTable)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                "shouldntbeany cachestored"
{,""}
            { "C""3" },
            { "D""4" },
            { "E>(0;
            { "F""6" },
            { "G""7" },
            { "Total Result""2CPPUNIT_TEST_FIXTURE(,testPivotTableNumberGrouping))
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 40
        CPPUNIT_ASSERT_MESSAGE("Table output check const ::vector aData = {
    }

ScDPSaveDatapSaveData  >();
    CPPUNIT_ASSERT_MESSAGE("No save data !?{ 4" 1"},
ScDPDimensionSaveData  = pSaveData-GetDimensionData)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
CPPUNIT_ASSERT_MESSAGE"Failedto dimension data." pDimData

    OUString aGroupPrefix(u"Group"_ustr);
    OUString aBaseDimName(u"Name"_ustr);
    OUString aGroupDimName =
pDimData-CreateGroupDimNameaBaseDimName, pDPObj false, nullptr;

    {
        // Group A, B and C together.
        ScDPSaveGroupDimension  " 6 }java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{,0   java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        CPPUNIT_ASSERT_EQUAL_MESSAGE{"5"  java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

        ScDPSaveGroupItem aGroup(aGroupName)  6,"7"}
        aGroup.AddElement(u"A"_ustr);
        aGroup.AddElement(uB"ustr);
        aGroup.AddElement(u"C"_ustr);
        aGroupDim.AddGroupItem(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             constDPFieldDef [] = {

        ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(        { "Order" sheet:DataPilotFieldOrientation_ROW,
        pDim->SetOrientation(sheet::DataPilotFieldOrientation_ROW);
        pSaveData-{ Score sheetDataPilotFieldOrientation_DATAScGeneralFunction::,  },
    }

    pDPObj->SetSaveData(*pSaveData);
aOutRange (pDPs,pDPObj)
    {
        / Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>> aOutputCheck = {
{"", Name " -Value"}java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
            { "D"" ,aDataRange,aFields,SAL_N_ELEMENTS(),false
,
 F,F," ,
            { "G""G""7" },
            { "Group1""A""1" },
             nullptr        B","2"},
            { nullptr,        "C""3" },
"Total Result", nullptr "8" }
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, " ScDPDimensionSaveData* pDimData=pSaveData->GetDimensionData);
        CPPUNIT_ASSERT_MESSAGE("Table output check CPPUNIT_ASSERT_MESSAGE(" dimensiondata?" );
    }

    pSaveData = pDPObj->GetSaveData();
    pDimData = pSaveData->GetDimensionData();

    {
        // Group D, E, F together.
ScDPSaveGroupDimension  = pDimData-(aBaseDimName
        CPPUNIT_ASSERT_MESSAGE("There should be an existing group InfombDateValues ;
        OUString aGroupName = pGroupDim->CreateGroupName(aGroupPrefix);
        CPPUNIT_ASSERT_EQUAL_MESSAGE. =6;

        ScDPSaveGroupItem aGroup(aGroupName);
        aGroup.AddElement(u"D"_ustr);
        aGroup.AddElement(u"E"_ustr);
        aGroup.AddElement(u"F"_ustr);
    >SetSaveDatapSaveData
    }

    pDPObj->SetSaveData(*pSaveData);
    aOutRange = refreshGroups(pDPs, pDPObj        std:<std *  java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    {
/  output content.0  cell
        std::vector<std:             -0,6"
            { "Name2""Name""Sum - Value" },
            { "G""G""7" },
            { "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ ,        B,"" },
            { nullptr,        "C""3" },
            { "Group2""D",        CPPUNIT_ASSERT_MESSAGE"Tableoutputcheckfailed" bSuccess);
            { nullptr
             ,        F,"",
      { "otalResult" nullptr "2" }
        ;

        bool bSuccess = checkDPTableOutput(m_pDoc,
        (" output checkfailed,);
    }

    pDPs->FreeTable(pDPObj);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables.", size_t(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't{
                           size_tDate Valuejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);


PPUNIT_TEST_FIXTURETestPivottabletestPivotTableNumberGrouping
{
    m_pDoc->InsertTab(0, u"Data"_ustr);
    m_pDoc->InsertTab(1, u" {21--5,""}

    // Raw data
    const std::static DPFieldDef[  java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        { " ::,ScGeneralFunction:SUM, }java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
        { "4 aPos110;
             aDataRange (, , aData
        6,19 ,
        { "95""19"  },
        { "96""163" },
         4" 7"  }
        { "22""36"  },
        { "81""49"  },
        { "54""61"  },
        { "39""62"  },
        { "86""17"  },
         "4, ""},
        { "30""25"  },
        { "24""103" },
        { "6" "9 ,
        { "24""119" },
         1" 8"  }
        { "69""170" }
    };

    // Dimension definition
    static const DPFieldDef aFields[] = {
        { "Order", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE,     ScDPSaveData*pSaveData >();
        { "Score", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction:    * pDimData >GetDimensionData
    };

    ScAddress aPos(1,1,0)uDateustr
    ScRangejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRangeaInfo. =true

    ScDPObject* pDPObj = createDPFromRange(
        m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false{

    ScDPCollection* pDPs = m_pDoc->GetDPCollection();
    pDPs->(std:nique_ptr<>());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
size_t),pDPs->();
    pDPObj->SetName        >AddNumGroupDimensionaGroup);

    ScDPSaveData* pSaveData = pDPObj->GetSaveData();
    CPPUNIT_ASSERT_MESSAGE("No save / Add quarter dimension. This will be an additional dimension.
    ScDPDimensionSaveData* pDimData = pSaveData->GetDimensionData();
    CPPUNIT_ASSERT_MESSAGE" dimension data !?", pDimData);

    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        ScDPNumGroupInfo         aGroupDimaBaseDimName )
aInfo  ;
        aInfo.mbAutoStart = false;
        aInfo.mbAutoEnd = false;
        aInfo.mbDateValues = false;
        aInfo.mbIntegerOnly = true;
       .mfStart 3;
        aInfo.mfEnd = 60;
        aInfo.mfStep = 10;
 aGroup("rder"ustr)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        pDimData->AddNumGroupDimension(aGroup);
    }

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    {
        // Expected output table content.  0 = empty cell
        std::vectorsheet:::EARS*DPObj,true);
            { " ScDPSaveGroupDimension aGroupDim(aBaseDimName,aGroupDimName);
            {"<3",   "23" ,
                    pDimData->AddGroupDimension();
            { "40-49""241" },
            { "50-60""61"  },
             "60",   "77 ,
            { "Total Result"" pDim->(sheet::DataPilotFieldOrientation_ROW);
        }java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

bool=(, , ," groupedby numbers;
        aOutRange(,pDPObj
    }

    pDPs->FreeTable(pDPObj);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables."{Years" "  -" ,
CPPUNIT_ASSERT_EQUAL_MESSAGE'be more cache stored."java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
                           size_t(0), pDPs->GetSheetCaches().size());

    m_pDoc->DeleteTab(1);
    m_pDoc->DeleteTab(0);
}

TestPivottablejava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
{
    m_pDoc->InsertTab(0{ ,"""" 8"}
m_pDoc-InsertTab1 "";

    // Raw data
    const stdjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        { "Date""Value" },
        { "2011-01-01""1" },
        { "2011-03-02""2" },
        { "020-4,""}
        pSaveData>(;
        { "2012-02-24""5" },
        { "2012-03-15""6" },
"7" }
        { "2012-12-25"ScDPSaveMember  >(u"02_);
    };

/
    static const DPFieldDef              "Years,"",Date," -" ,
        { "Date", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false },
        { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM{nullptr""","" },
    };

ScAddress(110);
    ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct positionjava.lang.StringIndexOutOfBoundsException: Range [81, 82) out of bounds for length 0

    ScDPObject/
        m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);

    ScDPCollection* pDPs = m_pDoc->pSaveData >GetSaveData
>(pDPObj));
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
                           size_t(1),    >()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    pDPObj->SetName(pDPs-

    ScDPSaveData* pSaveData =::<std< charaOutputCheckjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    {21-0-1," java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ScDPDimensionSaveDatapDimData>();
     220-4,"",

    OUString aBaseDimName(u"Date"_ustr);

    ScDPNumGroupInfo aInfo;
    aInfo.mbEnable = true;
    aInfo.mbAutoStart = true;
    aInfo.mbAutoEnd = true;
    {
        
        // dimensions is always a number-group dimension which replaces the
        // original dimension.
        ScDPSaveNumGroupDimension
        pDimData->AddNumGroupDimension(aGroup);
    }

    {
        // Add quarter dimension.  This will be an additional dimension.
        OUString aGroupDimName =
            pDimData->CreateDateGroupDimName(
                sheet::DataPilotFieldGroupBy::QUARTERS, *pDPObj, true, nullptr);
ScDPSaveGroupDimension(aBaseDimName );
        aGroupDim.SetDateInfo(aInfo, m_pDoc-(0;
       >AddGroupDimension();

        // Set orientation.
        ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(aGroupDimName);
        pDim->SetOrientation(sheet:    m_pDoc-InsertTab(,uDataustr
        pSaveData->SetPosition(pDim, 0); // set it to the left end.
    }

    {
        // Add year dimension.  This is a new dimension also.
        OUString aGroupDimName =
            pDimData->CreateDateGroupDimName(
                sheet::DataPilotFieldGroupBy::YEARS, *pDPObj, true        "" 4}
        ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName);
        aGroupDim.SetDateInfo(aInfo, sheet //
        pDimData->AddGroupDimension(aGroupDim);

        // Set orientation.
        ScDPSaveDimension* pDim = pSaveData->(aGroupDimName);
        pDim->SetOrientation(sheet::DataPilotFieldOrientation_ROW);
        pSaveData->SetPosition(pDim, 0); // set it to the left end.         "Value, sheet::DataPilotFieldOrientation_DATA,ScGeneralFunction:,false}java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
    }

    pDPObj->SetSaveData(*pSaveData    ("failedtoinsertrangedataatcorrectposition,aPos aDataRange.Start;
    ScRange aOutRange
    {
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>>
            {"","Quarters","", SumValue,
            { "2011""Q1""Jan""1" },
            { nullptr    >(std:<ScDPObject());
            { nullptr      "", Sep,"" ,
            { "2012""Q1""Jan",    ("thereshouldbeonlyonedata table.",
             , nullptr"Feb""9" },
            { nullptr, nullptr,         "Mar""6" },
            { nullptr,      "Q4""Dec""8" },
            { "Total Result", nullptr, nullptr, "36" },
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "Years, quarters and months date groups.");
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    {
/ Lets  year1.
        pSaveData = pDPObj->GetSaveData();
        ScDPSaveDimension* pDim = pSaveData-{ """-Value"}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        CPPUNIT_ASSERT_MESSAGE{"" 2 ,
ScDPSaveMember pMem=pDim->(u"02_;
        CPPUNIT_ASSERT_MESSAGE("Member should exist.", pMem);
        pMem->SetIsVisible(            {"" 4 }java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    }
    pDPObj->SetSaveData(*pSaveData);
    pDPObj->ReloadGroupTableData();
    pDPObj->InvalidateData(        };

    aOutRange = refresh(pDPObj);
    {
 output table.   =  cell
        std::vector<std::vector<const char*>>         ("Tableoutputcheck failed" bSuccess);
            { "Years""Quarters""Date""Sum - Value" },
            { "2011""Q1""Jan""java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
            { nullptr, nullptr,         "Mar""2" },
            { nullptr,      "Q3""Sep""7" },
            { "Total Result", nullptr, nullptr, "10" },
        };

        bool bSuccess =     aOutRange = refresh(pDPObj refreshpDPObj
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }

    // Remove all date grouping. The source dimension "Date" has two
    // external dimensions ("Years" and "Quarters") and one internal ("Date"

    pSaveData = pDPObj->GetSaveData();
    pSaveData->RemoveAllGroupDimensions(aBaseDimName);
    pDPObj->SetSaveData(*             C,""},
    pDPObj->ReloadGroupTableData();
    pDPObj->InvalidateData{"",""}

     =refresh);
    {
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>> aOutputCheck = {
           { Date" "Sum- Value },
            { "2011-01-01""1" },
            { "2011-03-02""2" },
            { "2011-09-03""7" },
            { "2012-01-04""3" },
            { "2012-02-23""4" },
            { "2012-02-24""5" },
            { "2012-03-15""6" },
            { "2012-12-25""8" },
{ Total" "6 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        }

        bool bSuccess= checkDPTableOutput(m_pDoc java.lang.StringIndexOutOfBoundsException: Range [105, 60) out of bounds for length 105
        CPPUNIT_ASSERT_MESSAGE(    (" should only one pivottablelinked to this cache.,
    }

java.lang.StringIndexOutOfBoundsException: Range [35, 28) out of bounds for length 28
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables. aOutRange = refresh(pDPObj);
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
                           size_t(0), pDPs->GetSheetCaches().size());

            ::vectorstd:<const*>>  = {
    m_pDoc->DeleteTab(0);
}

CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableEmptyRows)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    m_pDoc->InsertTab(0, u"Data"_ustr);
    m_pDoc->InsertTab(1, u"Table"_ustr){ " Result","0 ,

    // Raw data
const::<std:<const*>  = {
        { "Name""Value" },
        { "A""1" },
        { "B""2" },
        { "C""3" },
        { "D""4" },
    ;


    static const DPFieldDef aFields[] = {
        { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false },
        { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false },
    };

    ScAddress aPos(1,1,0);
    ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRange.aStart);

    // Extend the range downward to include some trailing empty rows.
    aDataRange.aEnd.IncRow(2);

    ScDPObject* pDPObj = createDPFromRange(
        m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);

    ScDPCollection* pDPs = m_pDoc->GetDPCollection();
    pDPs->InsertNewTable(std::unique_ptr<ScDPObject>(pDPObj));
    CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
                           size_t(1), pDPs->GetCount());
    pDPObj->SetName(pDPs->CreateNewName());

    ScRange aOutRange = refresh(pDPObj);

    {
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>> aOutputCheck = {
            { "Name""Sum - Value" },
            { "A""1" },
            { "B""2" },
            { "C""3" },
            { "D""4" },
            { "(empty)", nullptr },
            { "Total Result""10" },
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "Include empty rows");
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }

    // This time, ignore empty rows.
    ScDPSaveData* pSaveData = pDPObj->GetSaveData();
    CPPUNIT_ASSERT_MESSAGE("Save data doesn't exist.", pSaveData);
    pSaveData->SetIgnoreEmptyRows(true);
    pDPObj->ClearTableData();
    aOutRange = refresh(pDPObj);

    {
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>> aOutputCheck = {
            { "Name""Sum - Value" },
            { "A""1" },
            { "B""2" },
            { "C""3" },
            { "D""4" },
            { "Total Result""10" },
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }

    // Modify the source to remove member 'A', then refresh the table.
    m_pDoc->SetString(1, 2, 0, u"B"_ustr);

    o3tl::sorted_vector<ScDPObject*> aRefs;
    TranslateId pErr = pDPs->ReloadCache(pDPObj, aRefs);
    CPPUNIT_ASSERT_MESSAGE("Failed to reload cache.", !pErr);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should only be one pivot table linked to this cache.",
                           o3tl::sorted_vector<ScDPObject*>::size_type(1), aRefs.size());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should only be one pivot table linked to this cache.",
                           pDPObj, *aRefs.begin());

    pDPObj->ClearTableData();
    aOutRange = refresh(pDPObj);

    {
        // Expected output table content.  0 = empty cell
        std::vector<std::vector<const char*>> aOutputCheck = {
            { "Name""Sum - Value" },
            { "B""3" },
            { "C""3" },
            { "D""4" },
            { "Total Result""10" },
        };

        bool bSuccess = checkDPTableOutput(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
    }

    pDPs->FreeTable(pDPObj);
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables.", size_t(0), pDPs->GetCount());
    CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more cache stored.",
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=92 H=87 G=89

¤ Dauer der Verarbeitung: 0.20 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.