[PUSHED] Re: [PATCH] convert tools/table.hxx to std::map in DffPropSet class in filter module

Michael Stahl mstahl at redhat.com
Tue Mar 13 15:35:40 PDT 2012


On 09/03/12 16:23, Noel Grandin wrote:
> Hi
> 
> License statement already on file.
> 
> Regards, Noel Grandin

thanks, pushed.

your patch added trailing whitespace, which probably means that your git
hooks are not set up properly; please check your core/.git/hooks, there
should be a live symlink pre-commit -> /core/git-hooks/pre-commit.


these parts subtly change the semantics, because Table::Insert will do
nothing when the key already exists, while map::operator[] will
overwrite the entry; also Table::Replace will do nothing if the key does
not exist, while map::operator[] will add a new entry.

i don't know whether that is actually a problem in this code.

> --- a/filter/source/msfilter/msdffimp.cxx
> +++ b/filter/source/msfilter/msdffimp.cxx
> @@ -261,7 +261,7 @@ SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
>              // set flags that have to be set
>              rRec.mpContents[ nRecType ] |= nContent;
>              nContentEx |= ( nContent >> 16 );
> -            rRec.Replace( nRecType, (void*)(sal_uIntPtr)nContentEx );
> +            rRec.maRecordTypes[ nRecType ] = nContentEx;
>          }
>          else
>          {
> @@ -320,7 +320,7 @@ SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
>              }
>              rRec.mpContents[ nRecType ] = nContent;
>              rRec.mpFlags[ nRecType ] = aPropFlag;
> -            rRec.Insert( nRecType, (void*)(sal_uIntPtr)nContentEx );
> +            rRec.maRecordTypes[ nRecType ] = nContentEx;
>          }
>      }
>      aHd.SeekToEndOfRecord( rIn );
> @@ -454,7 +437,7 @@ void DffPropSet::Merge( DffPropSet& rMaster ) const
>                  DffPropFlags nFlags( rMaster.mpFlags[ nRecType ] );
>                  nFlags.bSoftAttr = sal_True;
>                  ( (DffPropSet*) this )->mpFlags[ nRecType ] = nFlags;
> -                ( (DffPropSet*) this )->Insert( nRecType, pDummy );
> +                ( (DffPropSet*) this )->maRecordTypes[ nRecType ] = it->second;
>              }
>          }
>      }
> @@ -5861,7 +5847,7 @@ void SvxMSDffManager::SetDgContainer( SvStream& rSt )
>          DffRecordHeader aRecHd;
>          rSt >> aRecHd;
>          sal_uInt32 nDrawingId = aRecHd.nRecInstance;
> -        maDgOffsetTable.Insert( nDrawingId, (void*)(sal_uIntPtr)nFilePos );
> +        maDgOffsetTable[ nDrawingId ] = nFilePos;
>          rSt.Seek( nFilePos );
>      }
>  }





More information about the LibreOffice mailing list