[Libreoffice] Removal of DECLARE_LIST() from Calc

Joseph Powers jpowers27 at cox.net
Thu Dec 9 05:26:45 PST 2010


Ok, the shadow on P is mine and is harmless. I've modified the code to remove the warning:

void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges)
{
    ScViewData* pView = GetViewData();
    ScDocShell* pDocSh = pView->GetDocShell();

    ScRangeList aRanges(rRanges);
    ScRange* p = aRanges.front();
    ScRangeList aRangesToMark;
    ScAddress aCurPos = pView->GetCurPos();
    for ( size_t i = 0, ListSize = aRanges.size(); i < ListSize; ++i )
    {
        p = aRanges.at( i );
        // Collect only those ranges that are on the same sheet as the current
        // cursor.
        if (p->aStart.Tab() == aCurPos.Tab())
            aRangesToMark.Append(*p);
    }

    if (aRangesToMark.empty())
        return;

    // Jump to the first range of all precedent ranges.
    p = aRangesToMark.front();
    lcl_jumpToRange(*p, pView, pDocSh->GetDocument());

    for ( size_t i = 0, ListSize = aRangesToMark.size(); i < ListSize; ++i )
    {
        p = aRangesToMark.at( i );
        MarkRange(*p, false, true);
    }
}

The others are pointing to things I didn't change, so I'm a little at a lost as to why the errors where generated.

Joe P.

On Dec 9, 2010, at 2:21 AM, Norbert Thiebaud wrote:

> On Thu, Dec 9, 2010 at 12:55 AM, Joseph Powers <jpowers27 at cox.net> wrote:
>> I'm converting ScRangeList from "DECLARE_LIST( ScRangeListBase, ScRange* ) "
>> to "::STD::vector< ScRange*> ScRangeListBase"
>> The most of the code boring and unlikely to cause issues; however, some
>> areas need further review:
>> sc/source/core/tool/rangelst.cxx <- This is the main class ScRangeList and a
>> child of ScRangeListBase. If this is wrong, we're in trouble.
>> - I changed GetCellCount() from ULONG to size_t which is more correct. Can
>> someone verify that this doesn't break 64bit builds?
>> sc/source/ui/miscdlgs/acredin.cxx
>> - Re-wrote some logic to not use iterators. A review would be nice.
>> sc/source/ui/unoobj/cellsuno.cxx
>> - The is huge with lots of changes.
>> 
>> I now pass a few size_t values to sal_Int32 & sal_uInt32 parameters. The Mac
>> build only supports 32bits currently so this isn't an issue. I need someone
>> with a 64bit build machine to review this patch.
> 
> Ok, I built it on a linux 64bits:
> 
> it build, but I get few warnings... not certain they are related, but
> still so you know:
> 
> 
> /lo/feature/bootstrap/clone/calc/sc/source/ui/view/viewfun6.cxx: In
> member function 'void ScViewFunc::MarkAndJumpToRanges(const
> ScRangeList&)':
> /lo/feature/bootstrap/clone/calc/sc/source/ui/view/viewfun6.cxx:176:
> warning: declaration of 'p' shadows a previous local
> /lo/feature/bootstrap/clone/calc/sc/source/ui/view/viewfun6.cxx:170:
> warning: shadowed declaration is here
> 
> Compiling: sc/source/ui/dbgui/tpsubt.cxx
> In file included from
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/ptr_map_adapter.hpp:20,
>                 from
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/ptr_map.hpp:21,
>                 from ../inc/xichart.hxx:47,
>                 from
> /lo/feature/bootstrap/clone/calc/sc/source/filter/excel/xichart.cxx:33:
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/detail/map_iterator.hpp:52:
> warning: type qualifiers ignored on function return type
> Compiling: sc/source/ui/dbgui/validate.cxx
> Compiling: sc/source/filter/excel/xlescher.cxx
> Compiling: sc/source/filter/excel/xlroot.cxx
> Compiling: sc/source/filter/excel/xltools.cxx
> In file included from
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/ptr_map_adapter.hpp:20,
>                 from
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/ptr_map.hpp:21,
>                 from ../inc/xichart.hxx:47,
>                 from
> /lo/feature/bootstrap/clone/calc/sc/source/filter/excel/xiescher.cxx:113:
> /lo/feature/bootstrap/solver/330/unxlngx6.pro/inc/boost/ptr_container/detail/map_iterator.hpp:52:
> warning: type qualifiers ignored on function return type
> 
> other than that. make dev-install + open of few speadsheet did not
> show anything alarming :-)
> 
> Norbert
> 
>> Joe P.
>> 
>> 
>> ps: Sorry about the size... but I had to change everything in one pass or
>> not at all.
>> _______________________________________________
>> LibreOffice mailing list
>> LibreOffice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>> 
>> 



More information about the LibreOffice mailing list