editeng/source/uno/unoedhlp.cxx | 4 filter/source/flash/swfwriter1.cxx | 2 filter/source/svg/svgexport.cxx | 13 filter/source/svg/svgwriter.cxx | 8 filter/source/svg/svgwriter.hxx | 2 include/editeng/unoedhlp.hxx | 4 include/svx/xoutbmp.hxx | 2 include/vcl/alpha.hxx | 2 include/vcl/animate.hxx | 4 include/vcl/bitmap.hxx | 2 include/vcl/bitmapex.hxx | 2 include/vcl/gdimtf.hxx | 2 include/vcl/graph.hxx | 2 sc/source/filter/starcalc/scflt.cxx | 779 ++++++++++++++-------------- sot/source/sdstor/ucbstorage.cxx | 42 - store/source/storbase.hxx | 4 store/source/storbios.cxx | 4 store/source/stordata.hxx | 8 svx/source/xoutdev/_xoutbmp.cxx | 6 sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2 sw/source/core/edit/editsh.cxx | 3 sw/source/filter/html/css1atr.cxx | 3 sw/source/filter/html/htmlflywriter.cxx | 6 sw/source/filter/html/wrthtml.cxx | 3 unotools/source/config/syslocaleoptions.cxx | 4 vcl/inc/impbmp.hxx | 6 vcl/inc/impgraph.hxx | 2 vcl/source/gdi/animate.cxx | 4 vcl/source/gdi/bitmap.cxx | 8 vcl/source/gdi/bitmapex.cxx | 2 vcl/source/gdi/gdimtf.cxx | 4 vcl/source/gdi/graph.cxx | 2 vcl/source/gdi/impgraph.cxx | 4 33 files changed, 473 insertions(+), 472 deletions(-)
New commits: commit d00ca13f880bbfe0fc987ef47184737dc74551d8 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sat Aug 29 16:49:46 2015 +0200 XOutBitmap::GraphicToBase64 can return bool instead of a sal_uLong error code, which no call place cares about Change-Id: I0d0dd16859e2f9678f47f484edf933e165b1ca48 diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx index 34e03c3..37fe77d 100644 --- a/include/svx/xoutbmp.hxx +++ b/include/svx/xoutbmp.hxx @@ -56,7 +56,7 @@ public: static sal_uInt16 WriteGraphic( const Graphic& rGraphic, OUString& rFileName, const OUString& rFilterName, const sal_uIntPtr nFlags = 0L, const Size* pMtfSize_100TH_MM = NULL ); - static sal_uLong GraphicToBase64(const Graphic& rGraphic,OUString& rOUString); + static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString); static sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, GraphicFilter& rFilter, const sal_uInt16 nFormat, diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index c6a71ae..3993018 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -327,7 +327,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } } -sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) +bool XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) { SvMemoryStream aOStm; OUString aMimeType; @@ -357,14 +357,14 @@ sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUStri if ( nErr ) { SAL_WARN("svx", "XOutBitmap::GraphicToBase64() invalid Graphic? error: " << nErr ); - return nErr; + return false; } aOStm.Seek(STREAM_SEEK_TO_END); css::uno::Sequence<sal_Int8> aOStmSeq( static_cast<sal_Int8 const *>(aOStm.GetData()),aOStm.Tell() ); OUStringBuffer aStrBuffer; ::sax::Converter::encodeBase64(aStrBuffer,aOStmSeq); rOUString = aMimeType + ";base64," + aStrBuffer.makeStringAndClear(); - return 0; + return true; } sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 02881ce..c630a76 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3235,8 +3235,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, const Graphic* pGrf = static_cast<const SvxBrushItem &>(rHt).GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 9e24f9a..e21b492 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1358,8 +1358,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, aHtml.start(OOO_STRING_SVTOOLS_HTML_image); OUString aGraphicInBase64; - sal_uLong nErr = XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64); - if (nErr) + if ( !XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } @@ -1425,8 +1424,7 @@ Writer& OutHTML_BulletImage( Writer& rWrt, const Graphic* pGrf = pBrush->GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 4e5d57b..ea5e12b 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1233,8 +1233,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic const Graphic* pGrf = pBrushItem->GetGraphic(); if( pGrf ) { - sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); - if( nErr ) + if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } commit caabdbc6d2272a7549ad3761b29f23c5947ff9b2 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sat Aug 29 13:00:33 2015 +0200 Unuseful temporary variable Change-Id: I926a69fa32b284475927e21f98f49330dde6d5b0 diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 4fb3dba..8950e62 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -126,8 +126,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) if ( rNode.IsTextNode() ) { SwIndex& rIdx = pTmpCrsr->GetPoint()->nContent; - sal_Int32 nPos = rIdx.GetIndex(); - sal_Int32 nPrevPos = nPos; + sal_Int32 nPrevPos = rIdx.GetIndex(); if ( nPrevPos ) --nPrevPos; commit 098df79fe179ebccafaaab0418505b32af31e1e8 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sat Aug 29 12:19:36 2015 +0200 Formatting and bail-out early (to not re-format too much) Change-Id: If4c55fe669f7bb861baca0ae224675ca74004de5 diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index d428523..9e12fa0 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -405,22 +405,22 @@ Sc10FontCollection::Sc10FontCollection(SvStream& rStream) : ScCollection(4, 4) , nError(0) { - sal_uInt16 ID(0); - rStream.ReadUInt16( ID ); - if (ID == FontID) - { - sal_uInt16 nAnz(0); - rStream.ReadUInt16( nAnz ); - for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + sal_uInt16 ID(0); + rStream.ReadUInt16( ID ); + if (ID == FontID) { - nError = insert_new<Sc10FontData>( this, rStream); + sal_uInt16 nAnz(0); + rStream.ReadUInt16( nAnz ); + for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + { + nError = insert_new<Sc10FontData>( this, rStream); + } + } + else + { + OSL_FAIL( "FontID" ); + nError = errUnknownID; } - } - else - { - OSL_FAIL( "FontID" ); - nError = errUnknownID; - } } // named regions @@ -446,22 +446,22 @@ Sc10NameCollection::Sc10NameCollection(SvStream& rStream) : ScCollection (4, 4), nError (0) { - sal_uInt16 ID; - rStream.ReadUInt16( ID ); - if (ID == NameID) - { - sal_uInt16 nAnz; - rStream.ReadUInt16( nAnz ); - for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + sal_uInt16 ID; + rStream.ReadUInt16( ID ); + if (ID == NameID) { - nError = insert_new<Sc10NameData>( this, rStream); + sal_uInt16 nAnz; + rStream.ReadUInt16( nAnz ); + for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + { + nError = insert_new<Sc10NameData>( this, rStream); + } + } + else + { + OSL_FAIL( "NameID" ); + nError = errUnknownID; } - } - else - { - OSL_FAIL( "NameID" ); - nError = errUnknownID; - } } // templates @@ -492,26 +492,26 @@ Sc10PatternData::Sc10PatternData(SvStream& rStream) rStream.Read(Reserved, sizeof(Reserved)); } -Sc10PatternCollection::Sc10PatternCollection(SvStream& rStream) : - ScCollection (4, 4), - nError (0) +Sc10PatternCollection::Sc10PatternCollection(SvStream& rStream) + : ScCollection(4, 4) + , nError(0) { - sal_uInt16 ID; - rStream.ReadUInt16( ID ); - if (ID == PatternID) - { - sal_uInt16 nAnz; - rStream.ReadUInt16( nAnz ); - for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + sal_uInt16 ID; + rStream.ReadUInt16( ID ); + if (ID == PatternID) { - nError = insert_new<Sc10PatternData>( this, rStream); + sal_uInt16 nAnz; + rStream.ReadUInt16( nAnz ); + for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + { + nError = insert_new<Sc10PatternData>( this, rStream); + } + } + else + { + OSL_FAIL( "PatternID" ); + nError = errUnknownID; } - } - else - { - OSL_FAIL( "PatternID" ); - nError = errUnknownID; - } } // database @@ -551,27 +551,27 @@ Sc10DataBaseData::Sc10DataBaseData(SvStream& rStream) DataBaseRec.QueryValue2 = ScfTools::ReadLongDouble(rStream); } -Sc10DataBaseCollection::Sc10DataBaseCollection(SvStream& rStream) : - ScCollection (4, 4), - nError (0) +Sc10DataBaseCollection::Sc10DataBaseCollection(SvStream& rStream) + : ScCollection(4, 4) + , nError(0) { - sal_uInt16 ID; - rStream.ReadUInt16( ID ); - if (ID == DataBaseID) - { - lcl_ReadFixedString( rStream, ActName, sizeof(ActName)); - sal_uInt16 nAnz; - rStream.ReadUInt16( nAnz ); - for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + sal_uInt16 ID; + rStream.ReadUInt16( ID ); + if (ID == DataBaseID) { - nError = insert_new<Sc10DataBaseData>( this, rStream); + lcl_ReadFixedString( rStream, ActName, sizeof(ActName)); + sal_uInt16 nAnz; + rStream.ReadUInt16( nAnz ); + for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++) + { + nError = insert_new<Sc10DataBaseData>( this, rStream); + } + } + else + { + OSL_FAIL( "DataBaseID" ); + nError = errUnknownID; } - } - else - { - OSL_FAIL( "DataBaseID" ); - nError = errUnknownID; - } } bool Sc10LogFont::operator==( const Sc10LogFont& rData ) const @@ -656,10 +656,10 @@ sal_uInt16 Sc10PageCollection::InsertFormat( const Sc10PageFormat& rData ) static inline sal_uInt8 GetMixedCol( const sal_uInt8 nB, const sal_uInt8 nF, const sal_uInt16 nFak ) { - sal_Int32 nT = nB - nF; - nT *= ( sal_Int32 ) nFak; - nT /= 0xFFFF; - nT += nF; + sal_Int32 nT = nB - nF; + nT *= ( sal_Int32 ) nFak; + nT /= 0xFFFF; + nT += nF; return ( sal_uInt8 ) nT; } static inline Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt16 nFact ) @@ -777,12 +777,12 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc ) bool bSwapCol = false; switch (pHeadFootLine->Raster) { - case raNone: nFact = 0xffff; bSwapCol = true; break; - case raGray12: nFact = (0xffff / 100) * 12; break; - case raGray25: nFact = (0xffff / 100) * 25; break; - case raGray50: nFact = (0xffff / 100) * 50; break; - case raGray75: nFact = (0xffff / 100) * 75; break; - default: nFact = 0xffff; + case raNone: nFact = 0xffff; bSwapCol = true; break; + case raGray12: nFact = (0xffff / 100) * 12; break; + case raGray25: nFact = (0xffff / 100) * 25; break; + case raGray50: nFact = (0xffff / 100) * 50; break; + case raGray75: nFact = (0xffff / 100) * 75; break; + default: nFact = 0xffff; } if( bSwapCol ) aSetItemItemSet.Put( SvxBrushItem( GetMixedColor( aBColor, aRColor, nFact ), ATTR_BACKGROUND ) ); @@ -791,58 +791,58 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc ) if (pHeadFootLine->Frame != 0) { - sal_uInt16 nLeft = 0; - sal_uInt16 nTop = 0; - sal_uInt16 nRight = 0; - sal_uInt16 nBottom = 0; - sal_uInt16 fLeft = (pHeadFootLine->Frame & 0x000F); - sal_uInt16 fTop = (pHeadFootLine->Frame & 0x00F0) / 0x0010; - sal_uInt16 fRight = (pHeadFootLine->Frame & 0x0F00) / 0x0100; - sal_uInt16 fBottom = (pHeadFootLine->Frame & 0xF000) / 0x1000; - if (fLeft > 1) - nLeft = 50; - else if (fLeft > 0) - nLeft = 20; - if (fTop > 1) - nTop = 50; - else if (fTop > 0) - nTop = 20; - if (fRight > 1) - nRight = 50; - else if (fRight > 0) - nRight = 20; - if (fBottom > 1) - nBottom = 50; - else if (fBottom > 0) - nBottom = 20; - Color ColorLeft(COL_BLACK); - Color ColorTop(COL_BLACK); - Color ColorRight(COL_BLACK); - Color ColorBottom(COL_BLACK); - sal_uInt16 cLeft = (pHeadFootLine->FrameColor & 0x000F); - sal_uInt16 cTop = (pHeadFootLine->FrameColor & 0x00F0) >> 4; - sal_uInt16 cRight = (pHeadFootLine->FrameColor & 0x0F00) >> 8; - sal_uInt16 cBottom = (pHeadFootLine->FrameColor & 0xF000) >> 12; - lcl_ChangeColor(cLeft, ColorLeft); - lcl_ChangeColor(cTop, ColorTop); - lcl_ChangeColor(cRight, ColorRight); - lcl_ChangeColor(cBottom, ColorBottom); - ::editeng::SvxBorderLine aLine; - SvxBoxItem aBox( ATTR_BORDER ); - aLine.SetWidth(nLeft); - aLine.SetColor(ColorLeft); - aBox.SetLine(&aLine, SvxBoxItemLine::LEFT); - aLine.SetWidth(nTop); - aLine.SetColor(ColorTop); - aBox.SetLine(&aLine, SvxBoxItemLine::TOP); - aLine.SetWidth(nRight); - aLine.SetColor(ColorRight); - aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT); - aLine.SetWidth(nBottom); - aLine.SetColor(ColorBottom); - aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM); - - aSetItemItemSet.Put(aBox); + sal_uInt16 nLeft = 0; + sal_uInt16 nTop = 0; + sal_uInt16 nRight = 0; + sal_uInt16 nBottom = 0; + sal_uInt16 fLeft = (pHeadFootLine->Frame & 0x000F); + sal_uInt16 fTop = (pHeadFootLine->Frame & 0x00F0) / 0x0010; + sal_uInt16 fRight = (pHeadFootLine->Frame & 0x0F00) / 0x0100; + sal_uInt16 fBottom = (pHeadFootLine->Frame & 0xF000) / 0x1000; + if (fLeft > 1) + nLeft = 50; + else if (fLeft > 0) + nLeft = 20; + if (fTop > 1) + nTop = 50; + else if (fTop > 0) + nTop = 20; + if (fRight > 1) + nRight = 50; + else if (fRight > 0) + nRight = 20; + if (fBottom > 1) + nBottom = 50; + else if (fBottom > 0) + nBottom = 20; + Color ColorLeft(COL_BLACK); + Color ColorTop(COL_BLACK); + Color ColorRight(COL_BLACK); + Color ColorBottom(COL_BLACK); + sal_uInt16 cLeft = (pHeadFootLine->FrameColor & 0x000F); + sal_uInt16 cTop = (pHeadFootLine->FrameColor & 0x00F0) >> 4; + sal_uInt16 cRight = (pHeadFootLine->FrameColor & 0x0F00) >> 8; + sal_uInt16 cBottom = (pHeadFootLine->FrameColor & 0xF000) >> 12; + lcl_ChangeColor(cLeft, ColorLeft); + lcl_ChangeColor(cTop, ColorTop); + lcl_ChangeColor(cRight, ColorRight); + lcl_ChangeColor(cBottom, ColorBottom); + ::editeng::SvxBorderLine aLine; + SvxBoxItem aBox( ATTR_BORDER ); + aLine.SetWidth(nLeft); + aLine.SetColor(ColorLeft); + aBox.SetLine(&aLine, SvxBoxItemLine::LEFT); + aLine.SetWidth(nTop); + aLine.SetColor(ColorTop); + aBox.SetLine(&aLine, SvxBoxItemLine::TOP); + aLine.SetWidth(nRight); + aLine.SetColor(ColorRight); + aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT); + aLine.SetWidth(nBottom); + aLine.SetColor(ColorBottom); + aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM); + + aSetItemItemSet.Put(aBox); } pSet->Put( SvxULSpaceItem( 0, 0, ATTR_ULSPACE ) ); @@ -1698,48 +1698,49 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) if (nError == 0) LoadAttr(aFlag); if (nError == 0) LoadAttr(aPattern); - if (nError == 0) + if (nError) + return; + + SCROW nStart; + SCROW nEnd; + sal_uInt16 i; + sal_uInt16 nLimit; + sal_uInt16 nValue1; + Sc10ColData *pColData; + + // Font (Name, Size) + nStart = 0; + nEnd = 0; + nLimit = aFont.Count; + pColData = aFont.pData; + for( i = 0 ; i < nLimit ; i++, pColData++ ) { - SCROW nStart; - SCROW nEnd; - sal_uInt16 i; - sal_uInt16 nLimit; - sal_uInt16 nValue1; - Sc10ColData *pColData; - - // Font (Name, Size) - nStart = 0; - nEnd = 0; - nLimit = aFont.Count; - pColData = aFont.pData; - for( i = 0 ; i < nLimit ; i++, pColData++ ) + nEnd = static_cast<SCROW>(pColData->Row); + if ((nStart <= nEnd) && (pColData->Value)) { - nEnd = static_cast<SCROW>(pColData->Row); - if ((nStart <= nEnd) && (pColData->Value)) + FontFamily eFam = FAMILY_DONTKNOW; + Sc10FontData* pFont = pFontCollection->At(pColData->Value); + if (pFont) { - FontFamily eFam = FAMILY_DONTKNOW; - Sc10FontData* pFont = pFontCollection->At(pColData->Value); - if (pFont) + switch (pFont->PitchAndFamily & 0xF0) { - switch (pFont->PitchAndFamily & 0xF0) - { - case ffDontCare : eFam = FAMILY_DONTKNOW; break; - case ffRoman : eFam = FAMILY_ROMAN; break; - case ffSwiss : eFam = FAMILY_SWISS; break; - case ffModern : eFam = FAMILY_MODERN; break; - case ffScript : eFam = FAMILY_SCRIPT; break; - case ffDecorative : eFam = FAMILY_DECORATIVE; break; - default: eFam = FAMILY_DONTKNOW; break; - } - ScPatternAttr aScPattern(pDoc->GetPool()); - aScPattern.GetItemSet().Put(SvxFontItem(eFam, SC10TOSTRING( pFont->FaceName ), EMPTY_OUSTRING, - PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT )); - aScPattern.GetItemSet().Put(SvxFontHeightItem(std::abs(pFont->Height), 100, ATTR_FONT_HEIGHT )); - pDoc->ApplyPatternAreaTab(Col, nStart, Col, nEnd, Tab, aScPattern); + case ffDontCare : eFam = FAMILY_DONTKNOW; break; + case ffRoman : eFam = FAMILY_ROMAN; break; + case ffSwiss : eFam = FAMILY_SWISS; break; + case ffModern : eFam = FAMILY_MODERN; break; + case ffScript : eFam = FAMILY_SCRIPT; break; + case ffDecorative : eFam = FAMILY_DECORATIVE; break; + default: eFam = FAMILY_DONTKNOW; break; } + ScPatternAttr aScPattern(pDoc->GetPool()); + aScPattern.GetItemSet().Put(SvxFontItem(eFam, SC10TOSTRING( pFont->FaceName ), EMPTY_OUSTRING, + PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT )); + aScPattern.GetItemSet().Put(SvxFontHeightItem(std::abs(pFont->Height), 100, ATTR_FONT_HEIGHT )); + pDoc->ApplyPatternAreaTab(Col, nStart, Col, nEnd, Tab, aScPattern); } - nStart = nEnd + 1; } + nStart = nEnd + 1; + } // Font color nStart = 0; @@ -1773,13 +1774,13 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) { ScPatternAttr aScPattern(pDoc->GetPool()); if ((nValue1 & atBold) == atBold) - aScPattern.GetItemSet().Put(SvxWeightItem(WEIGHT_BOLD, ATTR_FONT_WEIGHT)); + aScPattern.GetItemSet().Put(SvxWeightItem(WEIGHT_BOLD, ATTR_FONT_WEIGHT)); if ((nValue1 & atItalic) == atItalic) - aScPattern.GetItemSet().Put(SvxPostureItem(ITALIC_NORMAL, ATTR_FONT_POSTURE)); + aScPattern.GetItemSet().Put(SvxPostureItem(ITALIC_NORMAL, ATTR_FONT_POSTURE)); if ((nValue1 & atUnderline) == atUnderline) - aScPattern.GetItemSet().Put(SvxUnderlineItem(UNDERLINE_SINGLE, ATTR_FONT_UNDERLINE)); + aScPattern.GetItemSet().Put(SvxUnderlineItem(UNDERLINE_SINGLE, ATTR_FONT_UNDERLINE)); if ((nValue1 & atStrikeOut) == atStrikeOut) - aScPattern.GetItemSet().Put(SvxCrossedOutItem(STRIKEOUT_SINGLE, ATTR_FONT_CROSSEDOUT)); + aScPattern.GetItemSet().Put(SvxCrossedOutItem(STRIKEOUT_SINGLE, ATTR_FONT_CROSSEDOUT)); pDoc->ApplyPatternAreaTab(Col, nStart, Col, nEnd, Tab, aScPattern); } nStart = nEnd + 1; @@ -2121,7 +2122,6 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) } nStart = nEnd + 1; } - } } void Sc10Import::LoadAttr(Sc10ColAttr& rAttr) @@ -2155,246 +2155,247 @@ void Sc10Import::LoadAttr(Sc10ColAttr& rAttr) void Sc10Import::ChangeFormat(sal_uInt16 nFormat, sal_uInt16 nInfo, sal_uLong& nKey) { - // TODO: formats are mapped only for StarCalc 3.0 internal formats - // more correctly, at times new formats need to be created (Stephan: please check!) - nKey = 0; - switch (nFormat) - { - case vfStandard : - if (nInfo > 0) - nKey = 2; - break; - case vfMoney : - if (nInfo > 0) - nKey = 21; - else - nKey = 20; - break; - case vfThousend : - if (nInfo > 0) - nKey = 4; - else - nKey = 5; - break; - case vfPercent : - if (nInfo > 0) - nKey = 11; - else - nKey = 10; - break; - case vfExponent : - nKey = 60; - break; - case vfZerro : - // TODO: no equivalent - break; - case vfDate : - switch (nInfo) - { - case df_NDMY_Long : - nKey = 31; - break; - case df_DMY_Long : - nKey = 30; - break; - case df_MY_Long : - nKey = 32; - break; - case df_NDM_Long : - nKey = 31; - break; - case df_DM_Long : - nKey = 33; - break; - case df_M_Long : - nKey = 34; - break; - case df_NDMY_Short : - nKey = 31; - break; - case df_DMY_Short : - nKey = 30; - break; - case df_MY_Short : - nKey = 32; - break; - case df_NDM_Short : - nKey = 31; - break; - case df_DM_Short : - nKey = 33; - break; - case df_M_Short : - nKey = 34; - break; - case df_Q_Long : - nKey = 35; - break; - case df_Q_Short : - nKey = 35; - break; + // TODO: formats are mapped only for StarCalc 3.0 internal formats + // more correctly, at times new formats need to be created (Stephan: please check!) + nKey = 0; + switch (nFormat) + { + case vfStandard : + if (nInfo > 0) + nKey = 2; + break; + case vfMoney : + if (nInfo > 0) + nKey = 21; + else + nKey = 20; + break; + case vfThousend : + if (nInfo > 0) + nKey = 4; + else + nKey = 5; + break; + case vfPercent : + if (nInfo > 0) + nKey = 11; + else + nKey = 10; + break; + case vfExponent : + nKey = 60; + break; + case vfZerro : + // TODO: no equivalent + break; + case vfDate : + switch (nInfo) + { + case df_NDMY_Long : + nKey = 31; + break; + case df_DMY_Long : + nKey = 30; + break; + case df_MY_Long : + nKey = 32; + break; + case df_NDM_Long : + nKey = 31; + break; + case df_DM_Long : + nKey = 33; + break; + case df_M_Long : + nKey = 34; + break; + case df_NDMY_Short : + nKey = 31; + break; + case df_DMY_Short : + nKey = 30; + break; + case df_MY_Short : + nKey = 32; + break; + case df_NDM_Short : + nKey = 31; + break; + case df_DM_Short : + nKey = 33; + break; + case df_M_Short : + nKey = 34; + break; + case df_Q_Long : + nKey = 35; + break; + case df_Q_Short : + nKey = 35; + break; + default : + nKey = 30; + break; + } + break; + case vfTime : + switch (nInfo) + { + case tf_HMS_Long : + nKey = 41; + break; + case tf_HM_Long : + nKey = 40; + break; + case tf_HMS_Short : + nKey = 43; + break; + case tf_HM_Short : + nKey = 42; + break; + default : + nKey = 41; + break; + } + break; + case vfBoolean : + nKey = 99; + break; + case vfStandardRed : + if (nInfo > 0) + nKey = 2; + break; + case vfMoneyRed : + if (nInfo > 0) + nKey = 23; + else + nKey = 22; + break; + case vfThousendRed : + if (nInfo > 0) + nKey = 4; + else + nKey = 5; + break; + case vfPercentRed : + if (nInfo > 0) + nKey = 11; + else + nKey = 10; + break; + case vfExponentRed : + nKey = 60; + break; + case vfFormula : + break; + case vfString : + break; default : - nKey = 30; - break; - } - break; - case vfTime : - switch (nInfo) - { - case tf_HMS_Long : - nKey = 41; - break; - case tf_HM_Long : - nKey = 40; - break; - case tf_HMS_Short : - nKey = 43; - break; - case tf_HM_Short : - nKey = 42; - break; - default : - nKey = 41; - break; - } - break; - case vfBoolean : - nKey = 99; - break; - case vfStandardRed : - if (nInfo > 0) - nKey = 2; - break; - case vfMoneyRed : - if (nInfo > 0) - nKey = 23; - else - nKey = 22; - break; - case vfThousendRed : - if (nInfo > 0) - nKey = 4; - else - nKey = 5; - break; - case vfPercentRed : - if (nInfo > 0) - nKey = 11; - else - nKey = 10; - break; - case vfExponentRed : - nKey = 60; - break; - case vfFormula : - break; - case vfString : - break; - default : - break; - } + break; + } } void Sc10Import::LoadObjects() { - sal_uInt16 ID; - rStream.ReadUInt16( ID ); - if (rStream.IsEof()) return; - if (ID == ObjectID) - { - sal_uInt16 nAnz; - rStream.ReadUInt16( nAnz ); - sal_Char Reserved[32]; - rStream.Read(Reserved, sizeof(Reserved)); - nError = rStream.GetError(); - if ((nAnz > 0) && (nError == 0)) + sal_uInt16 ID; + rStream.ReadUInt16( ID ); + if (rStream.IsEof()) + return; + if (ID == ObjectID) { - sal_uInt8 ObjectType; - Sc10GraphHeader GraphHeader; - bool IsOleObject = false; // TODO: this is only a bandaid - for (sal_uInt16 i = 0; (i < nAnz) && (nError == 0) && !rStream.IsEof() && !IsOleObject; i++) - { - rStream.ReadUChar( ObjectType ); - lcl_ReadGraphHeader(rStream, GraphHeader); - - double nPPTX = ScGlobal::nScreenPPTX; - double nPPTY = ScGlobal::nScreenPPTY; - - long nStartX = 0; - SCCOL nMaxCol = SanitizeCol(GraphHeader.CarretX); - for (SCCOL nX = 0; nX < nMaxCol; ++nX) - nStartX += pDoc->GetColWidth(nX, static_cast<SCTAB>(GraphHeader.CarretZ)); - nStartX = (long) ( nStartX * HMM_PER_TWIPS ); - nStartX += (long) ( GraphHeader.x / nPPTX * HMM_PER_TWIPS ); - long nSizeX = (long) ( GraphHeader.w / nPPTX * HMM_PER_TWIPS ); - long nStartY = pDoc->GetRowHeight( 0, - SanitizeRow(static_cast<SCsROW>(GraphHeader.CarretY) - 1), - SanitizeTab(static_cast<SCTAB>(GraphHeader.CarretZ))); - nStartY = (long) ( nStartY * HMM_PER_TWIPS ); - nStartY += (long) ( GraphHeader.y / nPPTY * HMM_PER_TWIPS ); - long nSizeY = (long) ( GraphHeader.h / nPPTY * HMM_PER_TWIPS ); - - switch (ObjectType) + sal_uInt16 nAnz; + rStream.ReadUInt16( nAnz ); + sal_Char Reserved[32]; + rStream.Read(Reserved, sizeof(Reserved)); + nError = rStream.GetError(); + if ((nAnz > 0) && (nError == 0)) { - case otOle : - // TODO: here we need to do something like OleLoadFromStream - IsOleObject = true; - break; - case otImage : - { - Sc10ImageHeader ImageHeader; - lcl_ReadImageHeaer(rStream, ImageHeader); - - // Attention: here come the data (Bitmap oder Metafile) - // Typ = 1 Device-dependend Bitmap DIB - // Typ = 2 MetaFile - rStream.SeekRel(ImageHeader.Size); - - if( ImageHeader.Typ != 1 && ImageHeader.Typ != 2 ) - nError = errUnknownFormat; - break; - } - case otChart : - { - Sc10ChartHeader ChartHeader; - Sc10ChartSheetData ChartSheetData; - Sc10ChartTypeData* pTypeData = new (::std::nothrow) Sc10ChartTypeData; - if (!pTypeData) - nError = errOutOfMemory; - else + sal_uInt8 ObjectType; + Sc10GraphHeader GraphHeader; + bool IsOleObject = false; // TODO: this is only a bandaid + for (sal_uInt16 i = 0; (i < nAnz) && (nError == 0) && !rStream.IsEof() && !IsOleObject; i++) { - lcl_ReadChartHeader(rStream, ChartHeader); + rStream.ReadUChar( ObjectType ); + lcl_ReadGraphHeader(rStream, GraphHeader); + + double nPPTX = ScGlobal::nScreenPPTX; + double nPPTY = ScGlobal::nScreenPPTY; + + long nStartX = 0; + SCCOL nMaxCol = SanitizeCol(GraphHeader.CarretX); + for (SCCOL nX = 0; nX < nMaxCol; ++nX) + nStartX += pDoc->GetColWidth(nX, static_cast<SCTAB>(GraphHeader.CarretZ)); + nStartX = (long) ( nStartX * HMM_PER_TWIPS ); + nStartX += (long) ( GraphHeader.x / nPPTX * HMM_PER_TWIPS ); + long nSizeX = (long) ( GraphHeader.w / nPPTX * HMM_PER_TWIPS ); + long nStartY = pDoc->GetRowHeight( 0, + SanitizeRow(static_cast<SCsROW>(GraphHeader.CarretY) - 1), + SanitizeTab(static_cast<SCTAB>(GraphHeader.CarretZ))); + nStartY = (long) ( nStartY * HMM_PER_TWIPS ); + nStartY += (long) ( GraphHeader.y / nPPTY * HMM_PER_TWIPS ); + long nSizeY = (long) ( GraphHeader.h / nPPTY * HMM_PER_TWIPS ); + + switch (ObjectType) + { + case otOle : + // TODO: here we need to do something like OleLoadFromStream + IsOleObject = true; + break; + case otImage : + { + Sc10ImageHeader ImageHeader; + lcl_ReadImageHeaer(rStream, ImageHeader); + + // Attention: here come the data (Bitmap oder Metafile) + // Typ = 1 Device-dependend Bitmap DIB + // Typ = 2 MetaFile + rStream.SeekRel(ImageHeader.Size); + + if( ImageHeader.Typ != 1 && ImageHeader.Typ != 2 ) + nError = errUnknownFormat; + break; + } + case otChart : + { + Sc10ChartHeader ChartHeader; + Sc10ChartSheetData ChartSheetData; + Sc10ChartTypeData* pTypeData = new (::std::nothrow) Sc10ChartTypeData; + if (!pTypeData) + nError = errOutOfMemory; + else + { + lcl_ReadChartHeader(rStream, ChartHeader); - // TODO: use old Metafile ?? - rStream.SeekRel(ChartHeader.Size); + // TODO: use old Metafile ?? + rStream.SeekRel(ChartHeader.Size); - lcl_ReadChartSheetData(rStream, ChartSheetData); + lcl_ReadChartSheetData(rStream, ChartSheetData); - lcl_ReadChartTypeData(rStream, *pTypeData); + lcl_ReadChartTypeData(rStream, *pTypeData); - Rectangle aRect( Point(nStartX,nStartY), Size(nSizeX,nSizeY) ); - Sc10InsertObject::InsertChart( pDoc, static_cast<SCTAB>(GraphHeader.CarretZ), aRect, - static_cast<SCTAB>(GraphHeader.CarretZ), - ChartSheetData.DataX1, ChartSheetData.DataY1, - ChartSheetData.DataX2, ChartSheetData.DataY2 ); + Rectangle aRect( Point(nStartX,nStartY), Size(nSizeX,nSizeY) ); + Sc10InsertObject::InsertChart( pDoc, static_cast<SCTAB>(GraphHeader.CarretZ), aRect, + static_cast<SCTAB>(GraphHeader.CarretZ), + ChartSheetData.DataX1, ChartSheetData.DataY1, + ChartSheetData.DataX2, ChartSheetData.DataY2 ); - delete pTypeData; + delete pTypeData; + } + break; + } + default : + nError = errUnknownFormat; + break; + } + nError = rStream.GetError(); } - } - break; - default : - nError = errUnknownFormat; - break; } - nError = rStream.GetError(); - } } - } - else - { - OSL_FAIL( "ObjectID" ); - nError = errUnknownID; - } + else + { + OSL_FAIL( "ObjectID" ); + nError = errUnknownID; + } } FltError ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument ) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index bf1f72f..77ac2495 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -398,9 +398,9 @@ SvGlobalName GetClassId_Impl( SotClipboardFormatId nFormat ) // class, that uses the refcounted object as impl-class. enum RepresentModes { - nonset, - svstream, - xinputstream + nonset, + svstream, + xinputstream }; class UCBStorageStream_Impl : public SvRefBase, public SvStream @@ -450,7 +450,7 @@ public: BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream sal_uLong GetSize(); - sal_uInt64 ReadSourceWriteTemporary( sal_uInt64 aLength ); // read aLength from source and copy to temporary, + sal_uInt64 ReadSourceWriteTemporary( sal_uInt64 aLength ); // read aLength from source and copy to temporary, // no seeking is produced sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary, @@ -489,10 +489,10 @@ public: // this means that the root storage does an autocommit when its external // reference is destroyed bool m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts - bool m_bDirty; // ??? + bool m_bDirty; // ??? bool m_bIsLinked; bool m_bListCreated; - SotClipboardFormatId m_nFormat; + SotClipboardFormatId m_nFormat; OUString m_aUserTypeName; SvGlobalName m_aClassId; @@ -518,22 +518,25 @@ public: void ReadContent(); void CreateContent(); ::ucbhelper::Content* GetContent() - { if ( !m_pContent ) CreateContent(); return m_pContent; } + { + if ( !m_pContent ) + CreateContent(); + return m_pContent; + } UCBStorageElementList_Impl& GetChildrenList() { - long nError = m_nError; - ReadContent(); - if ( m_nMode & StreamMode::WRITE ) - { - m_nError = nError; - if ( m_pAntiImpl ) + long nError = m_nError; + ReadContent(); + if ( m_nMode & StreamMode::WRITE ) { - m_pAntiImpl->ResetError(); - m_pAntiImpl->SetError( nError ); + m_nError = nError; + if ( m_pAntiImpl ) + { + m_pAntiImpl->ResetError(); + m_pAntiImpl->SetError( nError ); + } } - } - - return m_aChildrenList; + return m_aChildrenList; } void SetError( long nError ); @@ -661,8 +664,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const OUString& rName, StreamMode if ( bRepair ) { - xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), - xProgress ); + xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), xProgress ); aTemp += "?repairpackage"; } commit 0871b509d24e0d30d2e0a4f4f38d6196def64ad1 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sat Aug 29 11:05:52 2015 +0200 Avoid explicit casts of (sizeof) constants known at compile time Partially revert my previous commit eb4cbea657b9038c488f1b1bcf5107cc226a6681 "Silence some conversion warnings", since no warning was really raised for these obvious conversions. Change-Id: Ie035655cdc56ceeb12a6141b168f7e9a8b863fee diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 78a51a1..73f2f77 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -512,7 +512,7 @@ struct PageData void guard (sal_uInt32 nAddr) { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); m_aDescr.m_nAddr = store::htonl(nAddr); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); @@ -523,7 +523,7 @@ struct PageData storeError verify (sal_uInt32 nAddr) const { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index 0b06795..f378894 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -120,7 +120,7 @@ struct OStoreSuperBlock void guard() { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -134,7 +134,7 @@ struct OStoreSuperBlock return store_E_WrongFormat; sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 17de3c3..e53a9b6 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -320,7 +320,7 @@ struct OStorePageNameBlock void guard() { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -330,7 +330,7 @@ struct OStorePageNameBlock storeError verify() const { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; @@ -424,7 +424,7 @@ struct OStoreDirectoryDataBlock void guard() { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -434,7 +434,7 @@ struct OStoreDirectoryDataBlock storeError verify() const { sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32))); + nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; commit 4fbda7634b813e521f4bd85d042b18f92bc03706 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Mon Aug 24 07:18:52 2015 +0200 sal_uLong to sal_uInt32 as SvxEditSourceHint ID Change-Id: Ic53ed8f1b6fd4554259e7b94640bb76b178f52dd diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index 460eda3..2ce5797 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -25,14 +25,14 @@ #include <osl/diagnose.h> -SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId ) : +SvxEditSourceHint::SvxEditSourceHint( sal_uInt32 _nId ) : TextHint( _nId ), mnStart( 0 ), mnEnd( 0 ) { } -SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId, sal_uLong nValue, sal_Int32 nStart, sal_Int32 nEnd ) : +SvxEditSourceHint::SvxEditSourceHint( sal_uInt32 _nId, sal_uLong nValue, sal_Int32 nStart, sal_Int32 nEnd ) : TextHint( _nId, nValue ), mnStart( nStart), mnEnd( nEnd ) diff --git a/include/editeng/unoedhlp.hxx b/include/editeng/unoedhlp.hxx index c35dbe4..ba352af 100644 --- a/include/editeng/unoedhlp.hxx +++ b/include/editeng/unoedhlp.hxx @@ -45,8 +45,8 @@ private: sal_Int32 mnEnd; public: - SvxEditSourceHint( sal_uLong nId ); - SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_Int32 nStart=0, sal_Int32 nEnd=0 ); + SvxEditSourceHint( sal_uInt32 nId ); + SvxEditSourceHint( sal_uInt32 nId, sal_uLong nValue, sal_Int32 nStart=0, sal_Int32 nEnd=0 ); sal_uLong GetValue() const; sal_Int32 GetStartValue() const { return mnStart;} commit beb8f3a6bf2b2549f5303f24119a9c07130b37a4 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Mon Aug 24 06:54:57 2015 +0200 SYSLOCALEOPTIONS_HINTs are sal_uInt32, not sal_uLong Change-Id: I931dfeef0c1c9fafd3e2e7415efe9a45f78989d0 diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index c349f2e..fb322bc 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -395,7 +395,7 @@ void SvtSysLocaleOptions_Impl::SetLocaleString( const OUString& rStr ) MakeRealLocale(); LanguageTag::setConfiguredSystemLanguage( m_aRealLocale.getLanguageType() ); SetModified(); - sal_uLong nHint = SYSLOCALEOPTIONS_HINT_LOCALE; + sal_uInt32 nHint = SYSLOCALEOPTIONS_HINT_LOCALE; if ( m_aCurrencyString.isEmpty() ) nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; NotifyListeners( nHint ); @@ -457,7 +457,7 @@ void SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange( bool bSet) void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) { - sal_uLong nHint = 0; + sal_uInt32 nHint = 0; Sequence< Any > seqValues = GetProperties( seqPropertyNames ); Sequence< sal_Bool > seqROStates = GetReadOnlyStates( seqPropertyNames ); sal_Int32 nCount = seqPropertyNames.getLength(); commit 986a172a749288d5ee09eb548ff4b4a7153023fe Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sun Aug 23 22:49:56 2015 +0200 sal_uLong to sal_uInt32 for CRC32 Change-Id: Id13e07f479615b8eb39d05e6534f514277cc3d03 diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index c510727..db9f332 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -787,7 +787,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQualityLevel ) { - sal_uLong bmpChecksum = bmpSource.GetChecksum(); + const sal_uInt32 bmpChecksum = bmpSource.GetChecksum(); ChecksumCache::iterator it = mBitmapCache.find(bmpChecksum); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index d600fb9..87891dc 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -421,10 +421,12 @@ bool ObjectRepresentation::operator==( const ObjectRepresentation& rPresentation } +namespace +{ -sal_uLong GetBitmapChecksum( const MetaAction* pAction ) +sal_uInt32 GetBitmapChecksum( const MetaAction* pAction ) { - sal_uLong nChecksum = 0; + sal_uInt32 nChecksum = 0; const MetaActionType nType = pAction->GetType(); switch( nType ) @@ -452,6 +454,7 @@ sal_uLong GetBitmapChecksum( const MetaAction* pAction ) return nChecksum; } +} void MetaBitmapActionGetPoint( const MetaAction* pAction, Point& rPt ) { @@ -506,8 +509,8 @@ bool EqualityBitmap::operator()( const ObjectRepresentation& rObjRep1, const GDIMetaFile& aMtf2 = rObjRep2.GetRepresentation(); if( aMtf1.GetActionSize() == 1 && aMtf2.GetActionSize() == 1 ) { - sal_uLong nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) ); - sal_uLong nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) ); + const sal_uInt32 nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) ); + const sal_uInt32 nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) ); return ( nChecksum1 == nChecksum2 ); } else @@ -1299,7 +1302,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps() MetaAction* pAction = aMtf.GetAction( 0 ); if( pAction ) { - sal_uLong nId = GetBitmapChecksum( pAction ); + const sal_uInt32 nId = GetBitmapChecksum( pAction ); sId = "bitmap(" + OUString::number( nId ) + ")"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index ce0e03b..73c01f2 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1359,7 +1359,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction } // bitmap placeholder element - sal_uLong nId = SVGActionWriter::GetChecksum( pAction ); + const sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction ); OUString sId = "bitmap-placeholder(" + msShapeId + "." + OUString::number( nId ) + ")"; @@ -1381,7 +1381,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps() const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf; OUString sId, sRefId; - sal_uLong nId, nChecksum = 0; + sal_uInt32 nChecksum = 0; Point aPt; Size aSz; sal_uLong nCount = rMtf.GetActionSize(); @@ -1415,7 +1415,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps() // <g id="?" > (used by animations) { // embedded bitmap id - nId = SVGActionWriter::GetChecksum( pAction ); + const sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction ); sId = "embedded-bitmap("; sId += msShapeId; sId += "."; @@ -1779,7 +1779,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo return aPathData; } -sal_uLong SVGActionWriter::GetChecksum( const MetaAction* pAction ) +sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction ) { GDIMetaFile aMtf; MetaAction* pA = const_cast<MetaAction*>(pAction); diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 928aad0ea..e96e516 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -357,7 +357,7 @@ private: public: static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine ); - static sal_uLong GetChecksum( const MetaAction* pAction ); + static sal_uInt32 GetChecksum( const MetaAction* pAction ); public: diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx index 13cf4f8..8aba78d 100644 --- a/include/vcl/alpha.hxx +++ b/include/vcl/alpha.hxx @@ -49,7 +49,7 @@ public: Size GetSizePixel() const { return Bitmap::GetSizePixel(); } - sal_uLong GetChecksum() const { return Bitmap::GetChecksum(); } + sal_uInt32 GetChecksum() const { return Bitmap::GetChecksum(); } Bitmap GetBitmap() const; diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx index 2ef68e7..7650d6f 100644 --- a/include/vcl/animate.hxx +++ b/include/vcl/animate.hxx @@ -88,7 +88,7 @@ struct VCL_DLLPUBLIC AnimationBitmap { return !( *this == rAnimBmp ); } - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; }; struct AInfo @@ -162,7 +162,7 @@ public: void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); sal_uLong GetSizeBytes() const; - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; public: diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 124ddbe..af92b3e 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -289,7 +289,7 @@ public: */ bool GetSystemData( BitmapSystemData& rData ) const; - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; Bitmap CreateDisplayBitmap( OutputDevice* pDisplay ); diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 0937f0b..a4b7857 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -91,7 +91,7 @@ public: sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); } sal_uLong GetSizeBytes() const; - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; public: diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index 197d795f..1ffb9dc 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -190,7 +190,7 @@ public: void SetPrefMapMode( const MapMode& rMapMode ) { aPrefMapMode = rMapMode; } - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; sal_uLong GetSizeBytes() const; // Methods for reading and writing the new formats; diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 7e01040..a99408d 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -160,7 +160,7 @@ public: sal_uLong GetAnimationLoopCount() const; - sal_uLong GetChecksum() const; + sal_uInt32 GetChecksum() const; public: diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 4108c49..576beae 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -750,7 +750,7 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx") Graphic aGraphic(xGraphic); // If this changes later, feel free to update it, but make sure it's not // the checksum of a white/transparent placeholder rectangle. - CPPUNIT_ASSERT_EQUAL(sal_uLong(2529763117U), aGraphic.GetChecksum()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(2529763117UL), aGraphic.GetChecksum()); #endif } diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx index 1fa17f8..412dcec 100644 --- a/vcl/inc/impbmp.hxx +++ b/vcl/inc/impbmp.hxx @@ -40,7 +40,7 @@ class ImpBitmap { private: sal_uLong mnRefCount; - sal_uLong mnChecksum; + sal_uInt32 mnChecksum; SalBitmap* mpSalBitmap; public: @@ -68,8 +68,8 @@ public: void ImplIncRefCount() { mnRefCount++; } void ImplDecRefCount() { mnRefCount--; } - inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; } - inline sal_uLong ImplGetChecksum() const { return mnChecksum; } + inline void ImplSetChecksum( sal_uInt32 nChecksum ) { mnChecksum = nChecksum; } + inline sal_uInt32 ImplGetChecksum() const { return mnChecksum; } bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ); bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ); diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 6baed71..b68e6d3 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -145,7 +145,7 @@ private: GfxLink ImplGetLink(); bool ImplIsLink() const; - sal_uLong ImplGetChecksum() const; + sal_uInt32 ImplGetChecksum() const; bool ImplExportNative( SvStream& rOStm ) const; diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index bd03f54..c1f8f4b 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -31,7 +31,7 @@ sal_uLong Animation::mnAnimCount = 0UL; -sal_uLong AnimationBitmap::GetChecksum() const +sal_uInt32 AnimationBitmap::GetChecksum() const { sal_uInt32 nCrc = aBmpEx.GetChecksum(); SVBT32 aBT32; @@ -206,7 +206,7 @@ sal_uLong Animation::GetSizeBytes() const return nSizeBytes; } -sal_uLong Animation::GetChecksum() const +sal_uInt32 Animation::GetChecksum() const { SVBT32 aBT32; sal_uInt32 nCrc = GetBitmapEx().GetChecksum(); diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 16e300c..9a69eb0 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -286,9 +286,9 @@ bool Bitmap::HasGreyPalette() const return bRet; } -sal_uLong Bitmap::GetChecksum() const +sal_uInt32 Bitmap::GetChecksum() const { - sal_uLong nRet = 0UL; + sal_uInt32 nRet = 0; if( mpImpBmp ) { @@ -329,9 +329,9 @@ sal_uLong Bitmap::GetChecksum() const pRAcc->GetPaletteEntryCount() * sizeof( BitmapColor ) ); } - nCrc = rtl_crc32( nCrc, pRAcc->GetBuffer(), pRAcc->GetScanlineSize() * pRAcc->Height() ); + nRet = rtl_crc32( nCrc, pRAcc->GetBuffer(), pRAcc->GetScanlineSize() * pRAcc->Height() ); - mpImpBmp->ImplSetChecksum( nRet = nCrc ); + mpImpBmp->ImplSetChecksum( nRet ); } if (pRAcc) ReleaseAccess( pRAcc ); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index e59d4ab..1a28a25 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -308,7 +308,7 @@ sal_uLong BitmapEx::GetSizeBytes() const return nSizeBytes; } -sal_uLong BitmapEx::GetChecksum() const +sal_uInt32 BitmapEx::GetChecksum() const { sal_uInt32 nCrc = aBitmap.GetChecksum(); SVBT32 aBT32; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 55cb26b..9979e3c 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2340,14 +2340,14 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const return aRet; } -sal_uLong GDIMetaFile::GetChecksum() const +sal_uInt32 GDIMetaFile::GetChecksum() const { GDIMetaFile aMtf; SvMemoryStream aMemStm( 65535, 65535 ); ImplMetaWriteData aWriteData; SVBT16 aBT16; SVBT32 aBT32; - sal_uLong nCrc = 0; + sal_uInt32 nCrc = 0; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet(); for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; i++ ) diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index cd7cfc3..93acaa1 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -535,7 +535,7 @@ bool Graphic::IsLink() const return mpImpGraphic->ImplIsLink(); } -sal_uLong Graphic::GetChecksum() const +sal_uInt32 Graphic::GetChecksum() const { return mpImpGraphic->ImplGetChecksum(); } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index e7626e3..9dc9a32 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1360,9 +1360,9 @@ bool ImpGraphic::ImplIsLink() const return ( mpGfxLink != NULL ); } -sal_uLong ImpGraphic::ImplGetChecksum() const +sal_uInt32 ImpGraphic::ImplGetChecksum() const { - sal_uLong nRet = 0; + sal_uInt32 nRet = 0; if( ImplIsSupportedGraphic() && !ImplIsSwapOut() ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits