[Libreoffice] [Patch] + Question about compilation warning on sd/source/ui/view/drviewsj.cxx

David Tardon dtardon at redhat.com
Wed Nov 10 21:32:54 PST 2010


On Wed, Nov 10, 2010 at 11:53:07PM +0100, julien wrote:
> Hello,
> 
> The patch contains only the removing of comments. I haven't removed 1
> line of comment because i don't know what "Wieder raus" mean.

Pushed.

> I would have like to remove a warning too since during compilation, I
> got this :
> /home/serval/libreoffice-source/build/build/libreoffice-3.2.99.2/sd/source/ui/view/drviewsj.cxx:
> In member function 'void sd::DrawViewShell::GetMenuStateSel(SfxItemSet&)':
> /home/serval/libreoffice-source/build/build/libreoffice-3.2.99.2/sd/source/ui/view/drviewsj.cxx:301:
> warning: declaration of 'rMarkList' shadows a previous local
> /home/serval/libreoffice-source/build/build/libreoffice-3.2.99.2/sd/source/ui/view/drviewsj.cxx:79:
> warning: shadowed declaration is here
> 
> The lines 79 and 301 contain this :
> const SdrMarkList&  rMarkList = mpDrawView->GetMarkedObjectList();
> 
> So i tried on line 301 to remove "const SdrMarkList&" to have this :
> rMarkList = mpDrawView->GetMarkedObjectList();
> 
> I got this :
> /home/serval/libreoffice-source/build/build/libreoffice-3.2.99.2/sd/source/ui/view/drviewsj.cxx:
> In member function 'void sd::DrawViewShell::GetMenuStateSel(SfxItemSet&)':
> /home/serval/libreoffice-source/build/build/libreoffice-3.2.99.2/sd/source/ui/view/drviewsj.cxx:301:
> error: passing 'const SdrMarkList' as 'this' argument of 'void
> SdrMarkList::operator=(const SdrMarkList&)' discards qualifiers
> 
> Perhaps line 301 is just a bad copy-paste but it would be surprising.
> 
> What do you think ?
> 

I removed the latter declaration, because it's initialized to the same
thing as the former one anyway, and the

if( rMarkList.GetMarkCount() == 1 )

test below it, because this's already been tested on line 81.

D.


More information about the LibreOffice mailing list