diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-17 10:33:03 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-17 10:33:03 +0000 |
commit | def439bf61a0ee058cb99ec1895d052a10fa4a19 (patch) | |
tree | 1cbab88198474baf91b73e8bd52dc048127567b1 | |
parent | 1b52154648707fd93d6c0147d243b803a1f25711 (diff) |
CWS-TOOLING: integrate CWS vcl99
2009-01-29 15:34:04 +0100 hdu r267149 : #i77520# fix AquaSalGraphics::GetGlyphBoundRect() result y-sign
2009-01-29 10:14:23 +0100 hdu r267099 : #i77520# implement AquaSalGraphics::GetGlyphBoundRect()
2009-01-28 17:31:17 +0100 hdu r267071 : #i79046# restore MultiSalLayout components after drawing them
2009-01-28 12:02:19 +0100 tl r267050 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 11:54:21 +0100 tl r267049 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 11:43:44 +0100 tl r267047 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 11:17:42 +0100 tl r267041 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 11:14:30 +0100 tl r267038 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 10:33:03 +0100 tl r267032 : #i72073# auto spellcheck markups in RTL context fixed
2009-01-28 09:26:00 +0100 tl r267027 : #78466# default curreny listbox for Arabic builds fixed
2009-01-28 09:25:31 +0100 tl r267026 : #78466# default curreny listbox for Arabic builds fixed
2009-01-27 16:55:14 +0100 tl r267009 : #78466# default curreny listbox for Arabic builds fixed
2009-01-27 16:54:46 +0100 tl r267008 : #78466# default curreny listbox for Arabic builds fixed
2009-01-27 16:52:23 +0100 tl r267007 : #78466# default curreny listbox for Arabic builds fixed
2009-01-27 16:46:52 +0100 tl r267006 : #i72073# auto spellcheck markups in RTL context fixed
2009-01-27 11:53:53 +0100 pl r266975 : #i98515# fix a buffer overflow
2009-01-26 19:13:28 +0100 pl r266946 : #i98119# add static vcl object helper
2009-01-26 18:11:06 +0100 pl r266940 : #i94040# catch a corner case (thanks af)
2009-01-23 10:54:42 +0100 pl r266793 : #i92102# fix some RTL UI issues
2009-01-23 10:53:35 +0100 pl r266790 : #i98169# one more case of DrawWaveLine
2009-01-23 08:38:32 +0100 hdu r266768 : #i98139# prefer Tools->Options->FontSubstitution over PreMatchHook
2009-01-21 17:30:57 +0100 pl r266694 : #i92102# adjust spin buttons
2009-01-21 13:54:16 +0100 pl r266667 : #i97130# add Click handler
2009-01-21 13:32:47 +0100 os r266662 : #158646# set SwWrtShell in C'tor of SwIndexMarkDlg
2009-01-21 12:14:03 +0100 pl r266649 : #i98196# fix autospellchecking in writer
2009-01-19 14:25:28 +0100 pl r266497 : #i97130# implement functionality of ExplainButton
-rw-r--r-- | psprint/source/fontmanager/fontmanager.cxx | 6 | ||||
-rw-r--r-- | svtools/inc/svtools/langtab.hxx | 3 | ||||
-rw-r--r-- | svtools/source/misc/langtab.cxx | 85 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 30 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salnativewidgets.cxx | 71 | ||||
-rw-r--r-- | vcl/inc/vcl/lazydelete.hxx | 54 | ||||
-rw-r--r-- | vcl/inc/vcl/svdata.hxx | 3 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 94 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 29 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 17 | ||||
-rwxr-xr-x | vcl/source/gdi/sallayout.cxx | 3 | ||||
-rw-r--r-- | vcl/source/helper/lazydelete.cxx | 45 |
12 files changed, 341 insertions, 99 deletions
diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx index 8fac64dc5b49..eb3dcbadff96 100644 --- a/psprint/source/fontmanager/fontmanager.cxx +++ b/psprint/source/fontmanager/fontmanager.cxx @@ -3279,7 +3279,8 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal analyzeTrueTypeFile( pFont ); } - for( sal_Unicode code = minCharacter; code <= maxCharacter; code++ ) + sal_Unicode code = minCharacter; + do { if( ! pFont->m_pMetrics || ! ( pFont->m_pMetrics->m_aPages[ code >> 11 ] & ( 1 << ( ( code >> 8 ) & 7 ) ) ) ) @@ -3299,7 +3300,8 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal if( it != pFont->m_pMetrics->m_aMetrics.end() ) pArray[ code - minCharacter ] = it->second; } - } + } while( code++ != maxCharacter ); + return true; } diff --git a/svtools/inc/svtools/langtab.hxx b/svtools/inc/svtools/langtab.hxx index 9117159b1a3c..3a70525bb450 100644 --- a/svtools/inc/svtools/langtab.hxx +++ b/svtools/inc/svtools/langtab.hxx @@ -52,6 +52,9 @@ public: LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const; }; +// Add LRE or RLE embedding characters to the string based on the +// String content (see #i78466#, #i32179#) +SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ); #endif diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 6226992136c8..870e6378a216 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -36,12 +36,97 @@ #include <tools/shl.hxx> #include <tools/debug.hxx> +//#include <com/sun/star/i18n/XCharacterClassification.hpp> +#include <com/sun/star/i18n/DirectionProperty.hpp> + #include <i18npool/lang.h> #include <i18npool/mslangid.hxx> #include <svtools/svtools.hrc> #include <svtools/svtdata.hxx> #include <svtools/langtab.hxx> +#include <svtools/syslocale.hxx> + + +using namespace ::com::sun::star; + +//------------------------------------------------------------------------ + +SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) +{ + const USHORT nLen = rText.Len(); + if (nLen == 0) + return String(); + + const sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding + const sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding + const sal_Unicode cPopDirectionalFormat = 0x202C; // the unicode PDF (POP_DIRECTIONAL_FORMAT) char that terminates an LRE/RLE embedding + + // check if there are alreay embedding characters at the strings start + // if so change nothing + const sal_Unicode cChar = rText.GetBuffer()[0]; + if (cChar == cLRE_Embedding || cChar == cRLE_Embedding) + return rText; + + // since we only call the function getCharacterDirection + // it does not matter which locale the CharClass is for. + // Thus we can readily make use of SvtSysLocale::GetCharClass() + // which should come at no cost... + SvtSysLocale aSysLocale; + const CharClass &rCharClass = aSysLocale.GetCharClass(); + + // we should look for the first non-neutral LTR or RTL character + // and use that to determine the embedding of the whole text... + // Thus we can avoid to check every character of the text. + bool bFound = false; + bool bIsRtlText = false; + for (USHORT i = 0; i < nLen && !bFound; ++i) + { + sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i ); + switch (nDirection) + { + case i18n::DirectionProperty_LEFT_TO_RIGHT : + case i18n::DirectionProperty_LEFT_TO_RIGHT_EMBEDDING : + case i18n::DirectionProperty_LEFT_TO_RIGHT_OVERRIDE : + case i18n::DirectionProperty_EUROPEAN_NUMBER : + case i18n::DirectionProperty_ARABIC_NUMBER : // yes! arabic numbers are written from left to right + { + bIsRtlText = false; + bFound = true; + break; + } + + case i18n::DirectionProperty_RIGHT_TO_LEFT : + case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC : + case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING : + case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE : + { + bIsRtlText = true; + bFound = true; + break; + } + + default: + { + // nothing to be done, character is considered to be neutral we need to look further ... + } + } + } + + sal_Unicode cStart = cLRE_Embedding; // default is to use LRE embedding characters + if (bIsRtlText) + cStart = cRLE_Embedding; // then use RLE embedding + + // add embedding start and end chars to the text if the direction could be determined + String aRes( rText ); + if (bFound) + { + aRes.Insert( cStart, 0 ); + aRes.Insert( cPopDirectionalFormat ); + } + + return aRes; +} //------------------------------------------------------------------------ diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index c93a5da11c30..962fa1302ae4 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1745,19 +1745,39 @@ BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& r long AquaSalGraphics::GetGraphicsWidth() const { + long w = 0; if( mrContext && (mbWindow || mbVirDev) ) { - return mnWidth; //CGBitmapContextGetWidth( mrContext ); + w = mnWidth; } - else - return 0; + + if( w == 0 ) + { + if( mbWindow && mpFrame ) + w = mpFrame->maGeometry.nWidth; + } + + return w; } // ----------------------------------------------------------------------- -BOOL AquaSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& ) +BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect ) { - return sal_False; + ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback + GlyphID aGlyphId = nGlyphId; + ATSGlyphScreenMetrics aGlyphMetrics; + OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle, + 1, &aGlyphId, 0, FALSE, !mbNonAntialiasedText, &aGlyphMetrics ); + if( eStatus != noErr ) + return false; + + const long nMinX = (long)(+aGlyphMetrics.topLeft.x * mfFontScale - 0.5); + const long nMaxX = (long)(aGlyphMetrics.width * mfFontScale + 0.5) + nMinX; + const long nMinY = (long)(-aGlyphMetrics.topLeft.y * mfFontScale - 0.5); + const long nMaxY = (long)(aGlyphMetrics.height * mfFontScale + 0.5) + nMinY; + rRect = Rectangle( nMinX, nMinY, nMaxX, nMaxY ); + return true; } // ----------------------------------------------------------------------- diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index d57e42899a14..9f2c7c4fa3a7 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -290,8 +290,6 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n break; case CTRL_SPINBUTTONS: - if( nPart == PART_ENTIRE_CONTROL || - nPart == PART_ALL_BUTTONS ) return false; break; @@ -695,26 +693,58 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, case CTRL_LISTNODE: { - HIThemeButtonDrawInfo aInfo; - aInfo.version = 0; - aInfo.kind = kThemeDisclosureButton; - aInfo.state = getState( nState ); - - aInfo.adornment = kThemeAdornmentNone; - ButtonValue aButtonValue = aValue.getTristateVal(); - switch( aButtonValue ) { - case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded - break; - case BUTTONVALUE_OFF: aInfo.value = kThemeDisclosureRight;//collapsed - break; - case BUTTONVALUE_DONTKNOW: //what to do? - default: - break; + if( Application::GetSettings().GetLayoutRTL() && aButtonValue == BUTTONVALUE_OFF ) + { + // FIXME: a value of kThemeDisclosureLeft + // should draw a theme compliant left disclosure triangle + // sadly this does not seem to work, so we'll draw a left + // grey equilateral triangle here ourselves. + // Perhaps some other HIThemeButtonDrawInfo setting would do the trick ? + + CGContextSetShouldAntialias( mrContext, true ); + float aGrey[] = { 0.45, 0.45, 0.45, 1.0 }; + CGContextSetFillColor( mrContext, aGrey ); + CGContextBeginPath( mrContext ); + float x = rc.origin.x + rc.size.width; + float y = rc.origin.y; + CGContextMoveToPoint( mrContext, x, y ); + y += rc.size.height; + CGContextAddLineToPoint( mrContext, x, y ); + x -= rc.size.height * 0.866; // cos( 30 degree ) is approx. 0.866 + y -= rc.size.height/2; + CGContextAddLineToPoint( mrContext, x, y ); + CGContextDrawPath( mrContext, kCGPathEOFill ); } + else + { + HIThemeButtonDrawInfo aInfo; + aInfo.version = 0; + aInfo.kind = kThemeDisclosureTriangle; + aInfo.value = kThemeDisclosureRight; + aInfo.state = getState( nState ); + + aInfo.adornment = kThemeAdornmentNone; + + switch( aButtonValue ) { + case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded + break; + case BUTTONVALUE_OFF: + // FIXME: this should have drawn a theme compliant disclosure triangle + // (see above) + if( Application::GetSettings().GetLayoutRTL() ) + { + aInfo.value = kThemeDisclosureLeft;//collapsed, RTL + } + break; + case BUTTONVALUE_DONTKNOW: //what to do? + default: + break; + } - HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + } bOK = true; } break; @@ -1041,7 +1071,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, HIRect buttonRc = ImplGetHIRectFromRectangle(aSpinRect); // FIXME: without this fuzz factor there is some unwanted clipping - buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ; + if( Application::GetSettings().GetLayoutRTL() ) + buttonRc.origin.x -= FOCUS_RING_WIDTH - CLIP_FUZZ; + else + buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ; switch( aValue.getTristateVal() ) { diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx index fa442c99e212..a0acba21fefa 100644 --- a/vcl/inc/vcl/lazydelete.hxx +++ b/vcl/inc/vcl/lazydelete.hxx @@ -205,6 +205,60 @@ namespace vcl } } }; + + /* + class DeleteOnDeinit matches a similar need as LazyDelete for static objects: + you may not access vcl objects after DeInitVCL has been called this includes their destruction + therefore disallowing the existance of static vcl object like e.g. a static BitmapEx + To work around this use DeleteOnDeinit<BitmapEx> which will allow you to have a static object container, + that will have its contents destroyed on DeinitVCL. The single drawback is that you need to check on the + container object whether it still contains content before actually accessing it. + + caveat: when constructing a vcl object, you certainly want to ensure that InitVCL has run already. + However this is not necessarily the case when using a class static member or a file level static variable. + In these cases make judicious use of the set() method of DeleteOnDeinit, but beware of the changing + ownership. + + example use case: use a lazy initialized on call BitmapEx in a paint method. Of course a paint method + would not normally be called after DeInitVCL anyway, so the check might not be necessary in a + Window::Paint implementation, but always checking is a good idea. + + SomeWindow::Paint() + { + static vcl::DeleteOnDeinitBase< BitmapEx > aBmp( new BitmapEx( ResId( 1000, myResMgr ) ) ); + + if( aBmp.get() ) // check whether DeInitVCL has been called already + DrawBitmapEx( Point( 10, 10 ), *aBmp.get() ); + } + */ + + class VCL_DLLPUBLIC DeleteOnDeinitBase + { + public: + static void SAL_DLLPRIVATE ImplDeleteOnDeInit(); + virtual ~DeleteOnDeinitBase(); + protected: + static void addDeinitContainer( DeleteOnDeinitBase* i_pContainer ); + + virtual void doCleanup() = 0; + }; + + template < typename T > + class VCL_DLLPUBLIC DeleteOnDeinit : public DeleteOnDeinitBase + { + T* m_pT; + virtual void doCleanup() { delete m_pT; m_pT = NULL; } + public: + DeleteOnDeinit( T* i_pT ) : m_pT( i_pT ) { addDeinitContainer( this ); } + virtual ~DeleteOnDeinit() {} + + // get contents + T* get() { return m_pT; } + + // set contents, returning old contents + // ownership is transfered ! + T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; } + }; } #endif diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx index a7f34ee5dd56..eabaa40be53e 100644 --- a/vcl/inc/vcl/svdata.hxx +++ b/vcl/inc/vcl/svdata.hxx @@ -113,7 +113,7 @@ class DockingManager; namespace vos { class OMutex; } namespace vos { class OCondition; } -namespace vcl { class DisplayConnection; class FontSubstConfiguration; class SettingsConfigItem; class DefaultFontConfiguration; } +namespace vcl { class DisplayConnection; class FontSubstConfiguration; class SettingsConfigItem; class DefaultFontConfiguration; class DeleteOnDeinitBase; } // ----------------- // - ImplSVAppData - @@ -346,6 +346,7 @@ struct ImplSVData ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge; com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient; ::vcl::SettingsConfigItem* mpSettingsConfigItem; + std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList; }; void ImplInitSVData(); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 83cbb8e809de..6c09978e37b1 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -43,67 +43,59 @@ // building X11 graphics layers. #if defined UNX && ! defined QUARTZ -#include <svunx.h> +#include "svunx.h" #endif -#ifndef _SV_SVSYS_HXX -#include <svsys.h> -#endif -#include <vcl/salinst.hxx> -#include <vcl/salwtype.hxx> -#ifndef _VOS_SIGNAL_HXX -#include <vos/signal.hxx> -#endif -#ifndef _VOS_SOCKET_HXX -#include <vos/socket.hxx> -#endif -#include <tools/tools.h> -#include <tools/debug.hxx> -#ifndef _UNIQID_HXX -#include <tools/unqid.hxx> -#endif -#include <vcl/svdata.hxx> -#include <vcl/dbggui.hxx> -#include <vcl/svapp.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/cvtgrf.hxx> -#include <vcl/image.hxx> -#ifndef _SV_RESMGR_HXX -#include <tools/resmgr.hxx> -#endif -#include <vcl/accmgr.hxx> -#include <vcl/idlemgr.hxx> -#include <vcl/outdev.h> -#include <vcl/outfont.hxx> -#include <vcl/print.h> -#include <vcl/settings.hxx> -#include <vcl/unowrap.hxx> -#include <vcl/salsys.hxx> -#include <vcl/saltimer.hxx> -#include <vcl/salimestatus.hxx> -#include <vcl/impimagetree.hxx> -#include <vcl/xconnection.hxx> - -#include <vos/process.hxx> -#include <osl/file.hxx> -#include <comphelper/processfactory.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <rtl/logfile.hxx> +#include "svsys.h" +#include "vcl/salinst.hxx" +#include "vcl/salwtype.hxx" +#include "vos/signal.hxx" +#include "tools/tools.h" +#include "tools/debug.hxx" +#include "tools/unqid.hxx" +#include "vcl/svdata.hxx" +#include "vcl/dbggui.hxx" +#include "vcl/svapp.hxx" +#include "vcl/wrkwin.hxx" +#include "vcl/cvtgrf.hxx" +#include "vcl/image.hxx" +#include "tools/resmgr.hxx" +#include "vcl/accmgr.hxx" +#include "vcl/idlemgr.hxx" +#include "vcl/outdev.h" +#include "vcl/outfont.hxx" +#include "vcl/print.h" +#include "vcl/settings.hxx" +#include "vcl/unowrap.hxx" +#include "vcl/salsys.hxx" +#include "vcl/saltimer.hxx" +#include "vcl/salimestatus.hxx" +#include "vcl/impimagetree.hxx" +#include "vcl/xconnection.hxx" + +#include "vos/process.hxx" +#include "osl/file.hxx" +#include "comphelper/processfactory.hxx" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/lang/XComponent.hpp" +#include "rtl/logfile.hxx" + +#include "vcl/fontcfg.hxx" +#include "vcl/configsettings.hxx" +#include "vcl/lazydelete.hxx" + +#include "cppuhelper/implbase1.hxx" +#include "uno/current_context.hxx" #if OSL_DEBUG_LEVEL > 0 #include <typeinfo> -#include <rtl/strbuf.hxx> +#include "rtl/strbuf.hxx" #endif using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -#include <vcl/fontcfg.hxx> -#include <vcl/configsettings.hxx> -#include <cppuhelper/implbase1.hxx> -#include <uno/current_context.hxx> // ======================================================================= @@ -355,6 +347,8 @@ void DeInitVCL() ImplSVData* pSVData = ImplGetSVData(); pSVData->mbDeInit = TRUE; + vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit(); + // give ime status a chance to destroy its own windows delete pSVData->mpImeStatus; pSVData->mpImeStatus = NULL; diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 3e2ab3205d9c..36a4fc5f5f24 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -265,20 +265,23 @@ void BitmapReadAccess::ImplZeroInitUnusedBits() DBG_ASSERT( 8*nScanSize >= nBits, "BitmapWriteAccess::ZeroInitUnusedBits: span size smaller than width?!"); const sal_uInt32 nLeftOverBits = 8*sizeof(sal_uInt8)*nScanSize - nBits; - const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; - sal_uInt8 nMask; - - if( bMsb ) - nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); - else - nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); - - BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes ); - for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) + if( nLeftOverBits != 0 ) // else there is really nothing to do { - *pLastBytes &= nMask; - for( sal_uInt32 j = 1; j < nBytes; j++ ) - pLastBytes[j] = 0; + const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; + sal_uInt8 nMask; + + if( bMsb ) + nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); + else + nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); + + BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes ); + for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) + { + *pLastBytes &= nMask; + for( sal_uInt32 j = 1; j < nBytes; j++ ) + pLastBytes[j] = 0; + } } } else if( nBits & 0x1f ) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index e421cb59aa4c..78b538e8bb57 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -2972,17 +2972,24 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, } } + // check if the current font name token or its substitute is valid + ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName ); + if( pFoundData ) + return pFoundData; + // some systems provide special customization // e.g. they suggest "serif" as UI-font, but this name cannot be used directly // because the system wants to map it to another font first, e.g. "Helvetica" if( mpPreMatchHook ) + { if( mpPreMatchHook->FindFontSubstitute( rFSD ) ) + { ImplGetEnglishSearchFontName( aSearchName ); - - // check if the current font name token or its substitute is valid - ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName ); - if( pFoundData ) - return pFoundData; + pFoundData = ImplFindBySearchName( aSearchName ); + if( pFoundData ) + return pFoundData; + } + } // break after last font name token was checked unsuccessfully if( nTokenPos == STRING_NOTFOUND) diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 0ac6610ab784..22db6cff9eb2 100755 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1950,11 +1950,12 @@ void MultiSalLayout::DrawText( SalGraphics& rGraphics ) const for( int i = mnLevel; --i >= 0; ) { SalLayout& rLayout = *mpLayouts[ i ]; - rLayout.DrawBase() = maDrawBase; + rLayout.DrawBase() += maDrawBase; rLayout.DrawOffset() += maDrawOffset; rLayout.InitFont(); rLayout.DrawText( rGraphics ); rLayout.DrawOffset() -= maDrawOffset; + rLayout.DrawBase() -= maDrawBase; } // NOTE: now the baselevel font is active again } diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx index 9b439a6df9af..f5a8d8fbb14e 100644 --- a/vcl/source/helper/lazydelete.cxx +++ b/vcl/source/helper/lazydelete.cxx @@ -33,9 +33,10 @@ #ifndef LAZYDELETE_CXX #define LAZYDELETE_CXX -#include <vcl/window.hxx> -#include <vcl/menu.hxx> -#include <vcl/lazydelete.hxx> +#include "vcl/window.hxx" +#include "vcl/menu.hxx" +#include "vcl/lazydelete.hxx" +#include "vcl/svdata.hxx" namespace vcl { @@ -81,6 +82,44 @@ template<> bool LazyDeletor<Menu>::is_less( Menu* left, Menu* right ) return left != NULL; } +DeleteOnDeinitBase::~DeleteOnDeinitBase() +{ +} + +void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer ) +{ + ImplSVData* pSVData = ImplGetSVData(); + if( ! pSVData ) + { + ImplInitSVData(); + pSVData = ImplGetSVData(); + } + + DBG_ASSERT( ! pSVData->mbDeInit, "DeleteOnDeinit added after DeiInitVCL !" ); + if( pSVData->mbDeInit ) + return; + + if( pSVData->mpDeinitDeleteList == NULL ) + pSVData->mpDeinitDeleteList = new std::list< DeleteOnDeinitBase* >(); + pSVData->mpDeinitDeleteList->push_back( i_pContainer ); } +void DeleteOnDeinitBase::ImplDeleteOnDeInit() +{ + ImplSVData* pSVData = ImplGetSVData(); + if( pSVData->mpDeinitDeleteList ) + { + for( std::list< vcl::DeleteOnDeinitBase* >::iterator it = pSVData->mpDeinitDeleteList->begin(); + it != pSVData->mpDeinitDeleteList->end(); ++it ) + { + (*it)->doCleanup(); + } + delete pSVData->mpDeinitDeleteList; + pSVData->mpDeinitDeleteList = NULL; + } +} + +} // namespace vcl + #endif + |