[Libreoffice-commits] .: 2 commits - vcl/inc vcl/source
vcl/inc/vcl/region.hxx | 16 +++ vcl/source/control/edit.cxx |3 - vcl/source/gdi/region.cxx | 90 ++-- 3 files changed, 47 insertions(+), 62 deletions(-) New commits: commit 2d691f26c6d4fd6fac11559f9b5b854d306e137a Author: Daniel Bankston daniel.dev.libreoff...@gmail.com Date: Mon Apr 2 19:35:34 2012 -0500 Ignore return type of Region::Intersect Caller of Region::Intersect was not ignore the return value in a conditional, so I refactored the conditional to not depend on the return value of Intersect without affect the original functionality of the code. This usage of Intersect may be a possible defect and should be checked out. diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 7d03316..b3f7516 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -670,7 +670,8 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout ) nIndex++; } i = nIndex; -if( aClip.Intersect( aRegion ) nAttr ) + aClip.Intersect(aRegion); +if( nAttr ) { Font aFont = GetFont(); if ( nAttr EXTTEXTINPUT_ATTR_UNDERLINE ) commit 93acb28e10760513b8bffd2c36dcbd68e75e57c7 Author: Daniel Bankston daniel.dev.libreoff...@gmail.com Date: Mon Apr 2 19:01:35 2012 -0500 fdo#44610 - EasyHack Since they always return sal_Bool values that are not used by any callers, I changed the Region class methods (both versions of each Union, Intersect, Exclude, XOr) from sal_Bool return type to void return type. diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx index f21cca4..5d3eccd 100644 --- a/vcl/inc/vcl/region.hxx +++ b/vcl/inc/vcl/region.hxx @@ -99,14 +99,14 @@ public: voidMove( long nHorzMove, long nVertMove ); voidScale( double fScaleX, double fScaleY ); -sal_BoolUnion( const Rectangle rRegion ); -sal_BoolIntersect( const Rectangle rRegion ); -sal_BoolExclude( const Rectangle rRegion ); -sal_BoolXOr( const Rectangle rRegion ); -sal_BoolUnion( const Region rRegion ); -sal_BoolIntersect( const Region rRegion ); -sal_BoolExclude( const Region rRegion ); -sal_BoolXOr( const Region rRegion ); +voidUnion( const Rectangle rRegion ); +voidIntersect( const Rectangle rRegion ); +voidExclude( const Rectangle rRegion ); +voidXOr( const Rectangle rRegion ); +voidUnion( const Region rRegion ); +voidIntersect( const Region rRegion ); +voidExclude( const Region rRegion ); +voidXOr( const Region rRegion ); RegionType GetType() const; sal_BoolIsEmpty() const { return GetType() == REGION_EMPTY; }; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index fa8ee5c..ee975d0 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1336,13 +1336,13 @@ void Region::Scale( double fScaleX, double fScaleY ) // --- -sal_Bool Region::Union( const Rectangle rRect ) +void Region::Union( const Rectangle rRect ) { DBG_CHKTHIS( Region, ImplDbgTestRegion ); // is rectangle empty? - nothing to do if ( rRect.IsEmpty() ) -return sal_True; +return; if( HasPolyPolygon() ) { @@ -1353,7 +1353,7 @@ sal_Bool Region::Union( const Rectangle rRect ) if( aThisPolyPoly.count() == 0 ) { *this = rRect; -return true; +return; } // get the other B2DPolyPolygon @@ -1363,7 +1363,7 @@ sal_Bool Region::Union( const Rectangle rRect ) basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly ); *this = Region( aClip ); -return sal_True; +return; } ImplPolyPolyRegionToBandRegion(); @@ -1394,13 +1394,11 @@ sal_Bool Region::Union( const Rectangle rRect ) delete mpImplRegion; mpImplRegion = (ImplRegion*)(aImplEmptyRegion); } - -return sal_True; } // --- -sal_Bool Region::Intersect( const Rectangle rRect ) +void Region::Intersect( const Rectangle rRect ) { DBG_CHKTHIS( Region, ImplDbgTestRegion ); @@ -1416,7 +1414,7 @@ sal_Bool Region::Intersect( const Rectangle rRect ) delete mpImplRegion; } mpImplRegion = (ImplRegion*)(aImplEmptyRegion); -return sal_True; +return; } // #103137# Avoid banding for special cases @@ -1434,7 +1432,7 @@ sal_Bool
[Libreoffice-commits] .: 2 commits - vcl/inc vcl/source vcl/win
vcl/inc/outfont.hxx|3 vcl/source/gdi/outdev3.cxx | 77 +++- vcl/win/source/gdi/salgdi3.cxx | 116 - vcl/win/source/gdi/salprn.cxx |1 vcl/win/source/window/salframe.cxx | 19 -- 5 files changed, 76 insertions(+), 140 deletions(-) New commits: commit f2601ba087d9d21af09134703b12de2a1d1763f8 Author: Thomas Arnhold tho...@arnhold.org Date: Sat Feb 18 14:40:11 2012 +0100 remove some unused windows code diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 692005d..e3e94b4 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1228,8 +1228,6 @@ sal_IntPtr ImplWinFontData::GetFontId() const // --- static unsigned GetUInt( const unsigned char* p ) { return((p[0]24)+(p[1]16)+(p[2]8)+p[3]);} -static unsigned GetUShort( const unsigned char* p ){ return((p[0]8)+p[1]);} -//static signed GetSShort( const unsigned char* p ){ return((short)((p[0]8)+p[1]));} static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]8)+(p[2]16)+(p[3]24)); } // --- @@ -1807,120 +1805,6 @@ int CALLBACK SalEnumCharSetsProcExA( const ENUMLOGFONTEXA* pLogFont, // --- -static void ImplGetAllFontCharSets( WinSalGraphics* pData ) -{ -if ( !pData-mpFontCharSets ) -pData-mpFontCharSets = new BYTE[256]; - -LOGFONTA aLogFont; -memset( aLogFont, 0, sizeof( aLogFont ) ); -aLogFont.lfCharSet = DEFAULT_CHARSET; -GetTextFaceA( pData-mhDC, sizeof( aLogFont.lfFaceName ), aLogFont.lfFaceName ); -EnumFontFamiliesExA( pData-mhDC, aLogFont, (FONTENUMPROCA)SalEnumCharSetsProcExA, - (LPARAM)(void*)pData, 0 ); -} - -// --- - -static void ImplAddKerningPairs( WinSalGraphics* pData ) -{ -sal_uLong nPairs = ::GetKerningPairsA( pData-mhDC, 0, NULL ); -if ( !nPairs ) -return; - -CHARSETINFO aInfo; -if ( !TranslateCharsetInfo( (DWORD*)(sal_uLong)GetTextCharset( pData-mhDC ), aInfo, TCI_SRCCHARSET ) ) -return; - -if ( !pData-mpFontKernPairs ) -pData-mpFontKernPairs = new KERNINGPAIR[nPairs]; -else -{ -KERNINGPAIR* pOldPairs = pData-mpFontKernPairs; -pData-mpFontKernPairs = new KERNINGPAIR[nPairs+pData-mnFontKernPairCount]; -memcpy( pData-mpFontKernPairs, pOldPairs, -pData-mnFontKernPairCount*sizeof( KERNINGPAIR ) ); -delete[] pOldPairs; -} - -UINTnCP = aInfo.ciACP; -sal_uLong nOldPairs = pData-mnFontKernPairCount; -KERNINGPAIR*pTempPair = pData-mpFontKernPairs+pData-mnFontKernPairCount; -nPairs = ::GetKerningPairsA( pData-mhDC, nPairs, pTempPair ); -for ( sal_uLong i = 0; i nPairs; i++ ) -{ -unsigned char aBuf[2]; -wchar_t nChar; -int nLen; -sal_BoolbAdd = TRUE; - -// None-ASCII?, then we must convert the char -if ( (pTempPair-wFirst 125) || (pTempPair-wFirst == 92) ) -{ -if ( pTempPair-wFirst 256 ) -{ -aBuf[0] = (unsigned char)pTempPair-wFirst; -nLen = 1; -} -else -{ -aBuf[0] = (unsigned char)(pTempPair-wFirst 8); -aBuf[1] = (unsigned char)(pTempPair-wFirst 0xFF); -nLen = 2; -} -if ( MultiByteToWideChar( nCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, - (const char*)aBuf, nLen, nChar, 1 ) ) -pTempPair-wFirst = nChar; -else -bAdd = FALSE; -} -if ( (pTempPair-wSecond 125) || (pTempPair-wSecond == 92) ) -{ -if ( pTempPair-wSecond 256 ) -{ -aBuf[0] = (unsigned char)pTempPair-wSecond; -nLen = 1; -} -else -{ -aBuf[0] = (unsigned char)(pTempPair-wSecond 8); -aBuf[1] = (unsigned char)(pTempPair-wSecond 0xFF); -nLen = 2; -} -if ( MultiByteToWideChar( nCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, - (const char*)aBuf, nLen, nChar, 1 ) ) -pTempPair-wSecond = nChar; -else -bAdd = FALSE; -} - -// TODO: get rid of linear search! -KERNINGPAIR* pTempPair2 = pData-mpFontKernPairs; -for ( sal_uLong j = 0; j nOldPairs; j++ ) -{ -if ( (pTempPair2-wFirst == pTempPair-wFirst) - (pTempPair2-wSecond == pTempPair-wSecond) ) -{ -bAdd =
[Libreoffice-commits] .: 2 commits - vcl/inc vcl/source writerfilter/inc writerfilter/source
vcl/inc/vcl/field.hxx |9 -- vcl/source/control/field2.cxx | 92 writerfilter/inc/resourcemodel/TagLogger.hxx|5 - writerfilter/source/resourcemodel/TagLogger.cxx | 53 - 4 files changed, 159 deletions(-) New commits: commit b0e993d42e1df8c68c4c2684ab9dda27a1329594 Author: August Sodora aug...@gmail.com Date: Mon Dec 19 21:56:10 2011 -0500 callcatcher: Remove unused code diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx index d45637c..2a13487 100644 --- a/writerfilter/inc/resourcemodel/TagLogger.hxx +++ b/writerfilter/inc/resourcemodel/TagLogger.hxx @@ -73,14 +73,9 @@ namespace writerfilter void element(const std::string name); void unoPropertySet(uno::Referencebeans::XPropertySet rPropSet); #endif -void startElement(const std::string name); void attribute(const std::string name, const std::string value); void attribute(const std::string name, const ::rtl::OUString value); -void attribute(const std::string name, sal_uInt32 value); -void attribute(const std::string name, const uno::Any aAny); void chars(const std::string chars); -void chars(const ::rtl::OUString chars); -void endElement(); #ifdef DEBUG_CONTEXT_HANDLER void propertySet(writerfilter::ReferenceProperties::Pointer_t props, diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx index 7b63ce0..6a0795c 100644 --- a/writerfilter/source/resourcemodel/TagLogger.cxx +++ b/writerfilter/source/resourcemodel/TagLogger.cxx @@ -156,13 +156,6 @@ namespace writerfilter #endif -void TagLogger::startElement(const string name) -{ -xmlChar* xmlName = xmlCharStrdup( name.c_str() ); -xmlTextWriterStartElement( pWriter, xmlName ); -xmlFree( xmlName ); -} - void TagLogger::attribute(const string name, const string value) { xmlChar* xmlName = xmlCharStrdup( name.c_str() ); @@ -178,42 +171,6 @@ namespace writerfilter attribute( name, OUStringToOString( value, RTL_TEXTENCODING_ASCII_US ).getStr() ); } -void TagLogger::attribute(const string name, sal_uInt32 value) -{ -xmlChar* xmlName = xmlCharStrdup( name.c_str() ); -xmlTextWriterWriteFormatAttribute( pWriter, xmlName, - % SAL_PRIuUINT32, value ); -xmlFree( xmlName ); -} - -void TagLogger::attribute(const string name, const uno::Any aAny) -{ -string aTmpStrInt; -string aTmpStrFloat; -string aTmpStrString; - -sal_Int32 nInt = 0; -float nFloat = 0.0; -::rtl::OUString aStr; - -xmlChar* xmlName = xmlCharStrdup( name.c_str() ); -if ( aAny = nInt ) -{ -xmlTextWriterWriteFormatAttribute( pWriter, xmlName, - % SAL_PRIdINT32, nInt ); -} -else if ( aAny = nFloat ) -{ -xmlTextWriterWriteFormatAttribute( pWriter, xmlName, - %f, nFloat ); -} -else if ( aAny = aStr ) -{ -attribute( name, aStr ); -} -xmlFree( xmlName ); -} - void TagLogger::chars(const string rChars) { xmlChar* xmlChars = xmlCharStrdup( rChars.c_str() ); @@ -221,16 +178,6 @@ namespace writerfilter xmlFree( xmlChars ); } -void TagLogger::chars(const ::rtl::OUString rChars) -{ -chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr()); -} - -void TagLogger::endElement() -{ -xmlTextWriterEndElement( pWriter ); -} - #ifdef DEBUG_CONTEXT_HANDLER class PropertySetDumpHandler : public Properties { commit f94db3d01631e75750431a87215338bf182f7c61 Author: August Sodora aug...@gmail.com Date: Mon Dec 19 21:45:29 2011 -0500 callcatcher: Remove unused code diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index 391a6e6..76a710d 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -386,8 +386,6 @@ public: voidSetDate( const Date rNewDate ); voidSetUserDate( const Date rNewDate ); DateGetDate() const; -DateGetRealDate() const; -sal_BoolIsDateModified() const; voidSetEmptyDate(); sal_BoolIsEmptyDate() const; DateGetCorrectedDate() const { return maCorrectedDate; } @@ -835,7 +833,6 @@ class VCL_DLLPUBLIC DateBox : public ComboBox, public DateFormatter { public: DateBox( Window* pParent, WinBits nWinStyle ); -DateBox( Window* pParent, const ResId rResId ); ~DateBox(); virtual long