diff options
Diffstat (limited to 'vcl/source')
46 files changed, 586 insertions, 398 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 64cdeab7b61f..9ffb8bc373da 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -533,6 +533,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : mnUseImagesInMenus = rData.mnUseImagesInMenus; mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus; mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus; + mbHideDisabledMenuItems = rData.mbHideDisabledMenuItems; mnAcceleratorsInContextMenus = rData.mnAcceleratorsInContextMenus; mnToolbarIconSize = rData.mnToolbarIconSize; mnSymbolsStyle = rData.mnSymbolsStyle; @@ -547,7 +548,7 @@ void ImplStyleData::SetStandardStyles() Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) ); aStdFont.SetCharSet( gsl_getSystemTextEncoding() ); aStdFont.SetWeight( WEIGHT_NORMAL ); - aStdFont.SetName( utl::DefaultFontConfiguration::get()->getUserInterfaceFont(com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString(), rtl::OUString() ) ) ); + aStdFont.SetName( utl::DefaultFontConfiguration::get().getUserInterfaceFont(com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString(), rtl::OUString() ) ) ); maAppFont = aStdFont; maHelpFont = aStdFont; maMenuFont = aStdFont; @@ -622,6 +623,7 @@ void ImplStyleData::SetStandardStyles() mnUseFlatMenues = 0; mbPreferredUseImagesInMenus = sal_True; mnSkipDisabledInMenus = (sal_uInt16)sal_False; + mbHideDisabledMenuItems = sal_False; mnAcceleratorsInContextMenus = sal_True; Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR ); @@ -751,6 +753,21 @@ void StyleSettings::SetPreferredSymbolsStyleName( const ::rtl::OUString &rName ) } } +void StyleSettings::SetCheckedColorSpecialCase( ) +{ + CopyData(); + // Light gray checked color special case + if ( GetFaceColor() == COL_LIGHTGRAY ) + mpData->maCheckedColor = Color( 0xCC, 0xCC, 0xCC ); + else + { + sal_uInt8 nRed = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetRed() + (sal_uInt16)mpData->maLightColor.GetRed())/2); + sal_uInt8 nGreen = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetGreen() + (sal_uInt16)mpData->maLightColor.GetGreen())/2); + sal_uInt8 nBlue = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetBlue() + (sal_uInt16)mpData->maLightColor.GetBlue())/2); + mpData->maCheckedColor = Color( nRed, nGreen, nBlue ); + } +} + // ----------------------------------------------------------------------- sal_uLong StyleSettings::GetCurrentSymbolsStyle() const @@ -1083,6 +1100,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) && (mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) && (mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) && + (mpData->mbHideDisabledMenuItems == rSet.mpData->mbHideDisabledMenuItems) && (mpData->mnAcceleratorsInContextMenus == rSet.mpData->mnAcceleratorsInContextMenus) && (mpData->maFontColor == rSet.mpData->maFontColor )) return sal_True; diff --git a/vcl/source/app/solarmutex.cxx b/vcl/source/app/solarmutex.cxx index 6423a74e6c61..ab07911fca32 100644 --- a/vcl/source/app/solarmutex.cxx +++ b/vcl/source/app/solarmutex.cxx @@ -54,4 +54,4 @@ void SolarMutexObject::release() osl_releaseMutex( m_solarMutex ); } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx index 57508219d8de..096321e05cfe 100644 --- a/vcl/source/app/unohelp.cxx +++ b/vcl/source/app/unohelp.cxx @@ -75,7 +75,7 @@ static VCLRegServiceInfo aVCLComponentsArray[] = {"dtransX11", sal_True}, #endif #endif -#if defined(WNT) || defined(OS2) +#if defined(WNT) {"sysdtrans", sal_False}, #endif {"dtrans", sal_False}, @@ -175,7 +175,7 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte OUString aLibName; -#if defined( WNT) || defined(OS2) +#if defined( WNT) aLibName = OUString::createFromAscii( pModName ); if ( bSUPD ) { diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 665448c4f3c9..e36cdaf9a0df 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2095,9 +2095,6 @@ void Edit::Command( const CommandEvent& rCEvt ) if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) { PopupMenu* pPopup = Edit::CreatePopupMenu(); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - if ( rStyleSettings.GetOptions() & STYLE_OPTION_HIDEDISABLED ) - pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES ); if ( !maSelection.Len() ) { @@ -2935,6 +2932,10 @@ PopupMenu* Edit::CreatePopupMenu() PopupMenu* pPopup = new PopupMenu( ResId( SV_RESID_MENU_EDIT, *pResMgr ) ); const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + if ( rStyleSettings.GetHideDisabledMenuItems() ) + pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES ); + else + pPopup->SetMenuFlags ( MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ); if ( rStyleSettings.GetAcceleratorsInContextMenus() ) { pPopup->SetAccelKey( SV_MENU_EDIT_UNDO, KeyCode( KEYFUNC_UNDO ) ); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index a6cd7b980620..77a1650bcdd1 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -127,26 +127,24 @@ ImplEntryList::~ImplEntryList() void ImplEntryList::Clear() { mnImages = 0; - for ( sal_uInt16 n = GetEntryCount(); n; ) - { - ImplEntryType* pImplEntry = GetEntry( --n ); - delete pImplEntry; - } - List::Clear(); + maEntries.clear(); } // ----------------------------------------------------------------------- void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect ) { - ImplEntryType* pImplEntry = GetEntry( nPos ); - if ( pImplEntry && - ( pImplEntry->mbIsSelected != bSelect ) && - ( (pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0 ) ) + if (nPos < maEntries.size()) { - pImplEntry->mbIsSelected = bSelect; - if ( mbCallSelectionChangedHdl ) - maSelectionChangedHdl.Call( (void*)sal_IntPtr(nPos) ); + boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+nPos; + + if ( ( iter->mbIsSelected != bSelect ) && + ( (iter->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0 ) ) + { + iter->mbIsSelected = bSelect; + if ( mbCallSelectionChangedHdl ) + maSelectionChangedHdl.Call( (void*)sal_IntPtr(nPos) ); + } } } @@ -180,9 +178,20 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry if ( !!pNewEntry->maImage ) mnImages++; - if ( !bSort || !Count() ) + sal_uInt16 insPos = 0; + + if ( !bSort || maEntries.empty()) { - Insert( pNewEntry, nPos ); + if (nPos < maEntries.size()) + { + insPos = nPos; + maEntries.insert( maEntries.begin() + nPos, pNewEntry ); + } + else + { + insPos = maEntries.size(); + maEntries.push_back(pNewEntry); + } } else { @@ -191,7 +200,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry const XubString& rStr = pNewEntry->maStr; sal_uLong nLow, nHigh, nMid; - nHigh = Count(); + nHigh = maEntries.size(); ImplEntryType* pTemp = GetEntry( (sal_uInt16)(nHigh-1) ); @@ -204,7 +213,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry // Schnelles Einfuegen bei sortierten Daten if ( eComp != COMPARE_LESS ) { - Insert( pNewEntry, LIST_APPEND ); + insPos = maEntries.size(); + maEntries.push_back(pNewEntry); } else { @@ -214,7 +224,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr); if ( eComp != COMPARE_GREATER ) { - Insert( pNewEntry, (sal_uLong)0 ); + insPos = 0; + maEntries.insert(maEntries.begin(),pNewEntry); } else { @@ -223,7 +234,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry do { nMid = (nLow + nHigh) / 2; - pTemp = (ImplEntryType*)GetObject( nMid ); + pTemp = (ImplEntryType*)GetEntry( nMid ); eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr); @@ -242,7 +253,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry if ( eComp != COMPARE_LESS ) nMid++; - Insert( pNewEntry, nMid ); + insPos = nMid; + maEntries.insert(maEntries.begin()+nMid,pNewEntry); } } } @@ -252,25 +264,27 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry // garbage you wouldn't insert it. If the exception occurred because the // Collator implementation is garbage then give the user a chance to see // his stuff - Insert( pNewEntry, (sal_uLong)0 ); + insPos = 0; + maEntries.insert(maEntries.begin(),pNewEntry); } } - return (sal_uInt16)GetPos( pNewEntry ); + return insPos; } // ----------------------------------------------------------------------- void ImplEntryList::RemoveEntry( sal_uInt16 nPos ) { - ImplEntryType* pImplEntry = (ImplEntryType*)List::Remove( nPos ); - if ( pImplEntry ) + boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+ nPos; + + if (iter != maEntries.end()) { - if ( !!pImplEntry->maImage ) + if ( !!iter->maImage ) mnImages--; - delete pImplEntry; + maEntries.erase(iter); } } @@ -278,11 +292,10 @@ void ImplEntryList::RemoveEntry( sal_uInt16 nPos ) sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchMRUArea ) const { - sal_uInt16 nEntries = GetEntryCount(); + sal_uInt16 nEntries = maEntries.size(); for ( sal_uInt16 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ ) { - ImplEntryType* pImplEntry = GetEntry( n ); - String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) ); + String aComp( vcl::I18nHelper::filterFormattingChars( maEntries[n].maStr ) ); if ( aComp == rString ) return n; } @@ -388,7 +401,7 @@ XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const { sal_Bool bImage = sal_False; - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); if ( pImplEntry ) bImage = !!pImplEntry->maImage; return bImage; @@ -399,7 +412,7 @@ sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const { Image aImage; - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); if ( pImplEntry ) aImage = pImplEntry->maImage; return aImage; @@ -409,7 +422,7 @@ Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData ) { - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); if ( pImplEntry ) pImplEntry->mpUserData = pNewData; } @@ -418,7 +431,7 @@ void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData ) void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const { - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); return pImplEntry ? pImplEntry->mpUserData : NULL; } @@ -426,7 +439,7 @@ void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags ) { - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); if ( pImplEntry ) pImplEntry->mnFlags = nFlags; } @@ -435,7 +448,7 @@ void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags ) long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const { - ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos ); + ImplEntryType* pImplEntry = GetEntry( nPos ); return pImplEntry ? pImplEntry->mnFlags : 0; } diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 4e3f8ceb0cf2..44ac9414534f 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1515,7 +1515,7 @@ static void allocTrueTypeFont( TrueTypeFont** ttf ) /* forward declariotn for the two entry points to use*/ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ); -#if !defined(WIN32) && !defined(OS2) +#if !defined(WIN32) int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf ) { int ret, fd = -1; @@ -1777,7 +1777,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) void CloseTTFont(TrueTypeFont *ttf) /*FOLD01*/ { -#if !defined(WIN32) && !defined(OS2) +#if !defined(WIN32) if( ttf->fname ) munmap((char *) ttf->ptr, ttf->fsize); #endif diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index 7a785b9bf99f..4356636e90a2 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -399,16 +399,19 @@ int StreamToFile(TrueTypeCreator *_this, const char* fname) FILE* fd; if ((r = StreamToMemory(_this, &ptr, &length)) != SF_OK) return r; - if (!fname) return SF_BADFILE; - if ((fd = fopen(fname, "wb")) == NULL) return SF_BADFILE; - - if (fwrite(ptr, 1, length, fd) != length) { - r = SF_FILEIO; - } else { - r = SF_OK; + if (fname && (fd = fopen(fname, "wb")) != NULL) + { + if (fwrite(ptr, 1, length, fd) != length) { + r = SF_FILEIO; + } else { + r = SF_OK; + } + fclose(fd); + } + else + { + r = SF_BADFILE; } - - fclose(fd); free(ptr); return r; } diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 2d9fbef36e44..21f977a45396 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -562,7 +562,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rMtf.SetPrefSize( aPrefSz ); rMtf.SetPrefMapMode( aMapMode ); - sal_uInt32 nLastPolygonAction(0); + size_t nLastPolygonAction(0); for( sal_Int32 i = 0L; i < nActions; i++ ) { @@ -631,7 +631,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) ImplReadExtendedPolyPolygonAction(rIStm, aInputPolyPolygon); // now check if it can be set somewhere - if(nLastPolygonAction < rMtf.GetActionCount()) + if(nLastPolygonAction < rMtf.GetActionSize()) { MetaPolyLineAction* pPolyLineAction = dynamic_cast< MetaPolyLineAction* >(rMtf.GetAction(nLastPolygonAction)); @@ -779,7 +779,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_POLYLINE_ACTION ): { ImplReadPoly( rIStm, aActionPoly ); - nLastPolygonAction = rMtf.GetActionCount(); + nLastPolygonAction = rMtf.GetActionSize(); if( bFatLine ) rMtf.AddAction( new MetaPolyLineAction( aActionPoly, aLineInfo ) ); @@ -802,7 +802,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) } else { - nLastPolygonAction = rMtf.GetActionCount(); + nLastPolygonAction = rMtf.GetActionSize(); rMtf.AddAction( new MetaPolygonAction( aActionPoly ) ); } } @@ -826,7 +826,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) } else { - nLastPolygonAction = rMtf.GetActionCount(); + nLastPolygonAction = rMtf.GetActionSize(); rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) ); } } @@ -1425,7 +1425,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rtl_TextEncoding& rActualCharSet ) { sal_uLong nCount = 0; - for( sal_uLong i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ ) + for( size_t i = 0, nActionCount = rMtf.GetActionSize(); i < nActionCount; i++ ) { const MetaAction* pAction = rMtf.GetAction( i ); diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index 9102f693c025..8ed39ea10fed 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -171,7 +171,7 @@ void Impl_Font::AskConfig() mbConfigLookup = true; // prepare the FontSubst configuration lookup - const utl::FontSubstConfiguration* pFontSubst = utl::FontSubstConfiguration::get(); + const utl::FontSubstConfiguration& rFontSubst = utl::FontSubstConfiguration::get(); String aShortName; String aFamilyName; @@ -184,11 +184,11 @@ void Impl_Font::AskConfig() aShortName, aFamilyName, eWeight, eWidthType, nType ); // lookup the font name in the configuration - const utl::FontNameAttr* pFontAttr = pFontSubst->getSubstInfo( aMapName ); + const utl::FontNameAttr* pFontAttr = rFontSubst.getSubstInfo( aMapName ); // if the direct lookup failed try again with an alias name if ( !pFontAttr && (aShortName != aMapName) ) - pFontAttr = pFontSubst->getSubstInfo( aShortName ); + pFontAttr = rFontSubst.getSubstInfo( aShortName ); if( pFontAttr ) { diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 93496bd2c2de..984386028cdc 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -153,52 +153,95 @@ struct ImpLabel // - LabelList - // ------------- -class ImpLabelList : private List +typedef ::std::vector< ImpLabel* > ImpLabelVector; + +class ImpLabelList { +private: + ImpLabelVector aList; + size_t nListPos; + public: - ImpLabelList() : List( 8, 4, 4 ) {} - ImpLabelList( const ImpLabelList& rList ); - ~ImpLabelList(); - - void ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); } - ImpLabel* ImplRemove( sal_uLong nPos ) { return (ImpLabel*) Remove( nPos ); } - void ImplReplace( ImpLabel* p ) { Replace( (void*)p ); } - ImpLabel* ImplFirst() { return (ImpLabel*) First(); } - ImpLabel* ImplNext() { return (ImpLabel*) Next(); } - ImpLabel* ImplGetLabel( sal_uLong nPos ) const { return (ImpLabel*) GetObject( nPos ); } - sal_uLong ImplGetLabelPos( const String& rLabelName ); - sal_uLong ImplCount() const { return Count(); } + ImpLabelList() {} + ImpLabelList( const ImpLabelList& rList ); + ~ImpLabelList(); + + void ImplInsert( ImpLabel* p ) { aList.push_back( p ); } + + ImpLabel* ImplFirst(); + ImpLabel* ImplNext(); + ImpLabel* ImplGetLabel( size_t nPos ) const; + ImpLabel* ImplRemove( size_t nPos ); + + size_t ImplGetLabelPos( const String& rLabelName ); + size_t ImplCount() const { return aList.size(); } }; // ------------------------------------------------------------------------ -ImpLabelList::ImpLabelList( const ImpLabelList& rList ) : - List( rList ) +ImpLabelList::ImpLabelList( const ImpLabelList& rList ) { - for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() ) - ImplReplace( new ImpLabel( *pLabel ) ); + for( size_t i = 0, n = rList.ImplCount(); i < n; ++i ) + aList.push_back( new ImpLabel( *rList.ImplGetLabel( i ) ) ); + nListPos = 0; } // ------------------------------------------------------------------------ ImpLabelList::~ImpLabelList() { - for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() ) - delete pLabel; + for( size_t i = 0, n = aList.size(); i < n; ++i ) + delete aList[ i ]; + aList.clear(); } // ------------------------------------------------------------------------ +ImpLabel* ImpLabelList::ImplFirst() +{ + nListPos = 0; + return ( aList.empty() ) ? NULL : aList[ nListPos ]; +} -sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName ) +// ------------------------------------------------------------------------ +ImpLabel* ImpLabelList::ImplNext() { - sal_uLong nLabelPos = METAFILE_LABEL_NOTFOUND; + return ( nListPos + 1 < aList.size() ) ? aList[ ++nListPos ] : NULL; +} - for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() ) +// ------------------------------------------------------------------------ + +ImpLabel* ImpLabelList::ImplGetLabel( size_t nPos ) const +{ + return ( nPos < aList.size() ) ? aList[ nPos ] : NULL; +} + +// ------------------------------------------------------------------------ + +ImpLabel* ImpLabelList::ImplRemove( size_t nPos ) +{ + ImpLabel* return_value = NULL; + if ( nPos < aList.size() ) { - if ( rLabelName == pLabel->aLabelName ) + ImpLabelVector::iterator it = aList.begin(); + ::std::advance( it, nPos ); + return_value = *it; + aList.erase( it ); + } + return return_value; +} + +// ------------------------------------------------------------------------ + +size_t ImpLabelList::ImplGetLabelPos( const String& rLabelName ) +{ + size_t nLabelPos = METAFILE_LABEL_NOTFOUND; + + for ( size_t i = 0, n = aList.size(); i < n; ++i ) + { + if ( rLabelName == aList[ i ]->aLabelName ) { - nLabelPos = GetCurPos(); + nLabelPos = i; break; } } @@ -211,7 +254,6 @@ sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName ) // --------------- GDIMetaFile::GDIMetaFile() : - List ( 0x3EFF, 64, 64 ), aPrefSize ( 1, 1 ), pPrev ( NULL ), pNext ( NULL ), @@ -226,7 +268,6 @@ GDIMetaFile::GDIMetaFile() : // ------------------------------------------------------------------------ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) : - List ( rMtf ), aPrefMapMode ( rMtf.aPrefMapMode ), aPrefSize ( rMtf.aPrefSize ), aHookHdlLink ( rMtf.aHookHdlLink ), @@ -238,8 +279,11 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) : bUseCanvas ( rMtf.bUseCanvas ) { // RefCount der MetaActions erhoehen - for( void* pAct = First(); pAct; pAct = Next() ) - ( (MetaAction*) pAct )->Duplicate(); + for( size_t i = 0, n = rMtf.GetActionSize(); i < n; ++i ) + { + rMtf.GetAction( i )->Duplicate(); + aList.push_back( rMtf.GetAction( i ) ); + } if( rMtf.pLabelList ) pLabelList = new ImpLabelList( *rMtf.pLabelList ); @@ -264,17 +308,62 @@ GDIMetaFile::~GDIMetaFile() // ------------------------------------------------------------------------ +size_t GDIMetaFile::GetActionSize() const +{ + return aList.size(); +} + +// ------------------------------------------------------------------------ + +MetaAction* GDIMetaFile::GetAction( size_t nAction ) const +{ + return (nAction < aList.size()) ? aList[ nAction ] : NULL; +} + +// ------------------------------------------------------------------------ + +MetaAction* GDIMetaFile::FirstAction() +{ + nCurrentActionElement = 0; + return aList.empty() ? NULL : aList[ 0 ]; +} + +// ------------------------------------------------------------------------ + +MetaAction* GDIMetaFile::NextAction() +{ + return ( nCurrentActionElement + 1 < aList.size() ) ? aList[ ++nCurrentActionElement ] : NULL; +} + +// ------------------------------------------------------------------------ + +MetaAction* GDIMetaFile::ReplaceAction( MetaAction* pAction, size_t nAction ) +{ + if ( nAction < aList.size() ) + { + ::std::vector< MetaAction* >::iterator it = aList.begin(); + ::std::advance( it, nAction ); + (*it)->Delete(); + *it = pAction; + } + return pAction; +} + + +// ------------------------------------------------------------------------ + GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf ) { if( this != &rMtf ) { Clear(); - List::operator=( rMtf ); - // RefCount der MetaActions erhoehen - for( void* pAct = First(); pAct; pAct = Next() ) - ( (MetaAction*) pAct )->Duplicate(); + for( size_t i = 0, n = rMtf.GetActionSize(); i < n; ++i ) + { + rMtf.GetAction( i )->Duplicate(); + aList.push_back( rMtf.GetAction( i ) ); + } if( rMtf.pLabelList ) pLabelList = new ImpLabelList( *rMtf.pLabelList ); @@ -307,20 +396,20 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf ) sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const { - const sal_uLong nObjCount = Count(); + const size_t nObjCount = aList.size(); sal_Bool bRet = sal_False; if( this == &rMtf ) bRet = sal_True; - else if( rMtf.GetActionCount() == nObjCount && - rMtf.GetPrefSize() == aPrefSize && + else if( rMtf.GetActionSize() == nObjCount && + rMtf.GetPrefSize() == aPrefSize && rMtf.GetPrefMapMode() == aPrefMapMode ) { bRet = sal_True; - for( sal_uLong n = 0UL; n < nObjCount; n++ ) + for( size_t n = 0; n < nObjCount; n++ ) { - if( GetObject( n ) != rMtf.GetObject( n ) ) + if( aList[ n ] != rMtf.GetAction( n ) ) { bRet = sal_False; break; @@ -335,20 +424,20 @@ sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const sal_Bool GDIMetaFile::IsEqual( const GDIMetaFile& rMtf ) const { - const sal_uLong nObjCount = Count(); + const size_t nObjCount = aList.size(); sal_Bool bRet = sal_False; if( this == &rMtf ) bRet = sal_True; - else if( rMtf.GetActionCount() == nObjCount && - rMtf.GetPrefSize() == aPrefSize && + else if( rMtf.GetActionSize() == nObjCount && + rMtf.GetPrefSize() == aPrefSize && rMtf.GetPrefMapMode() == aPrefMapMode ) { bRet = sal_True; - for( sal_uLong n = 0UL; n < nObjCount; n++ ) + for( size_t n = 0; n < nObjCount; n++ ) { - if(!((MetaAction*)GetObject( n ))->IsEqual(*((MetaAction*)rMtf.GetObject( n )))) + if( !aList[ n ]->IsEqual( *(rMtf.GetAction( n )) ) ) { bRet = sal_False; break; @@ -366,10 +455,9 @@ void GDIMetaFile::Clear() if( bRecord ) Stop(); - for( void* pAct = First(); pAct; pAct = Next() ) - ( (MetaAction*) pAct )->Delete(); - - List::Clear(); + for( size_t i = 0, n = aList.size(); i < n; ++i ) + aList[ i ]->Delete(); + aList.clear(); delete pLabelList; pLabelList = NULL; @@ -424,7 +512,7 @@ void GDIMetaFile::Record( OutputDevice* pOut ) if( bRecord ) Stop(); - Last(); + nCurrentActionElement = aList.empty() ? 0 : (aList.size() - 1); pOutDev = pOut; bRecord = sal_True; Linker( pOut, sal_True ); @@ -432,19 +520,19 @@ void GDIMetaFile::Record( OutputDevice* pOut ) // ------------------------------------------------------------------------ -void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos ) +void GDIMetaFile::Play( GDIMetaFile& rMtf, size_t nPos ) { if ( !bRecord && !rMtf.bRecord ) { MetaAction* pAction = GetCurAction(); - const sal_uLong nObjCount = Count(); + const size_t nObjCount = aList.size(); rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas ); if( nPos > nObjCount ) nPos = nObjCount; - for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ ) + for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ ) { if( !Hook() ) { @@ -452,20 +540,21 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos ) rMtf.AddAction( pAction ); } - pAction = (MetaAction*) Next(); + pAction = NextAction(); } } } // ------------------------------------------------------------------------ -void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos ) +void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) { if( !bRecord ) { MetaAction* pAction = GetCurAction(); - const sal_uLong nObjCount = Count(); - sal_uLong i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff; + const size_t nObjCount = aList.size(); + size_t i = 0; + size_t nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff; if( nPos > nObjCount ) nPos = nObjCount; @@ -478,7 +567,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos ) pOut->SetLayoutMode( 0 ); pOut->SetDigitLanguage( 0 ); - for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ ) + for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ ) { if( !Hook() ) { @@ -498,7 +587,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos ) ( (Window*) pOut )->Flush(), i = 0; } - pAction = (MetaAction*) Next(); + pAction = NextAction(); } pOut->Pop(); @@ -656,7 +745,7 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, // ------------------------------------------------------------------------ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, - const Size& rSize, sal_uLong nPos ) + const Size& rSize, size_t nPos ) { Region aDrawClipRegion; MapMode aDrawMap( GetPrefMapMode() ); @@ -760,7 +849,7 @@ void GDIMetaFile::Stop() void GDIMetaFile::WindStart() { if( !bRecord ) - First(); + nCurrentActionElement = 0; } // ------------------------------------------------------------------------ @@ -768,15 +857,15 @@ void GDIMetaFile::WindStart() void GDIMetaFile::WindEnd() { if( !bRecord ) - Last(); + nCurrentActionElement = aList.empty() ? 0 : (aList.size() - 1); } // ------------------------------------------------------------------------ -void GDIMetaFile::Wind( sal_uLong nActionPos ) +void GDIMetaFile::Wind( size_t nActionPos ) { if( !bRecord ) - Seek( nActionPos ); + nCurrentActionElement = nActionPos < aList.size() ? nActionPos : nCurrentActionElement; } // ------------------------------------------------------------------------ @@ -784,7 +873,8 @@ void GDIMetaFile::Wind( sal_uLong nActionPos ) void GDIMetaFile::WindPrev() { if( !bRecord ) - Prev(); + if ( nCurrentActionElement > 0 ) + --nCurrentActionElement; } // ------------------------------------------------------------------------ @@ -792,14 +882,15 @@ void GDIMetaFile::WindPrev() void GDIMetaFile::WindNext() { if( !bRecord ) - Next(); + if ( nCurrentActionElement + 1 < aList.size() ) + ++nCurrentActionElement; } // ------------------------------------------------------------------------ void GDIMetaFile::AddAction( MetaAction* pAction ) { - Insert( pAction, LIST_APPEND ); + aList.push_back( pAction ); if( pPrev ) { @@ -810,9 +901,18 @@ void GDIMetaFile::AddAction( MetaAction* pAction ) // ------------------------------------------------------------------------ -void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos ) +void GDIMetaFile::AddAction( MetaAction* pAction, size_t nPos ) { - Insert( pAction, nPos ); + if ( nPos < aList.size() ) + { + ::std::vector< MetaAction* >::iterator it = aList.begin(); + ::std::advance( it, nPos ); + aList.insert( it, pAction ); + } + else + { + aList.push_back( pAction ); + } if( pPrev ) { @@ -823,10 +923,24 @@ void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos ) // ------------------------------------------------------------------------ +void GDIMetaFile::push_back( MetaAction* pAction ) +{ + aList.push_back( pAction ); +} + +// ------------------------------------------------------------------------ + // @since #110496# -void GDIMetaFile::RemoveAction( sal_uLong nPos ) +void GDIMetaFile::RemoveAction( size_t nPos ) { - Remove( nPos ); + if ( nPos < aList.size() ) + { + ::std::vector< MetaAction* >::iterator it = aList.begin(); + ::std::advance( it, nPos ); + (*it)->Delete(); + aList.erase( it ); + + } if( pPrev ) pPrev->RemoveAction( nPos ); @@ -834,14 +948,14 @@ void GDIMetaFile::RemoveAction( sal_uLong nPos ) // ------------------------------------------------------------------------ -MetaAction* GDIMetaFile::CopyAction( sal_uLong nPos ) const +MetaAction* GDIMetaFile::CopyAction( size_t nPos ) const { - return ( (MetaAction*) GetObject( nPos ) )->Clone(); + return ( nPos < aList.size() ) ? aList[ nPos ]->Clone() : NULL; } // ------------------------------------------------------------------------ -sal_uLong GDIMetaFile::GetActionPos( const String& rLabel ) +size_t GDIMetaFile::GetActionPos( const String& rLabel ) { ImpLabel* pLabel = NULL; @@ -855,7 +969,7 @@ sal_uLong GDIMetaFile::GetActionPos( const String& rLabel ) // ------------------------------------------------------------------------ -sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos ) +sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, size_t nActionPos ) { sal_Bool bRet = sal_False; @@ -899,14 +1013,14 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel ) // ------------------------------------------------------------------------ -sal_uLong GDIMetaFile::GetLabelCount() const +size_t GDIMetaFile::GetLabelCount() const { return( pLabelList ? pLabelList->ImplCount() : 0UL ); } // ------------------------------------------------------------------------ -String GDIMetaFile::GetLabel( sal_uLong nLabel ) +String GDIMetaFile::GetLabel( size_t nLabel ) { String aString; @@ -1000,14 +1114,14 @@ void GDIMetaFile::Move( long nX, long nY ) aMapVDev.EnableOutput( sal_False ); aMapVDev.SetMapMode( GetPrefMapMode() ); - for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { const long nType = pAct->GetType(); MetaAction* pModAct; if( pAct->GetRefCount() > 1 ) { - Replace( pModAct = pAct->Clone(), GetCurPos() ); + aList[ nCurrentActionElement ] = pModAct = pAct->Clone(); pAct->Delete(); } else @@ -1035,14 +1149,14 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) aMapVDev.SetReferenceDevice( nDPIX, nDPIY ); aMapVDev.SetMapMode( GetPrefMapMode() ); - for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { const long nType = pAct->GetType(); MetaAction* pModAct; if( pAct->GetRefCount() > 1 ) { - Replace( pModAct = pAct->Clone(), GetCurPos() ); + aList[ nCurrentActionElement ] = pModAct = pAct->Clone(); pAct->Delete(); } else @@ -1072,13 +1186,13 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) void GDIMetaFile::Scale( double fScaleX, double fScaleY ) { - for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { MetaAction* pModAct; if( pAct->GetRefCount() > 1 ) { - Replace( pModAct = pAct->Clone(), GetCurPos() ); + aList[ nCurrentActionElement ] = pModAct = pAct->Clone(); pAct->Delete(); } else @@ -1108,7 +1222,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect ) aMapVDev.EnableOutput( sal_False ); aMapVDev.SetMapMode( GetPrefMapMode() ); - for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { const long nType = pAct->GetType(); @@ -1126,7 +1240,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect ) if( pOldAct->IsClipping() ) aNewReg.Intersect( pOldAct->GetRegion() ); MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, sal_True ); - Replace( pNewAct, GetCurPos() ); + aList[ nCurrentActionElement ] = pNewAct; pOldAct->Delete(); } } @@ -1187,10 +1301,10 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf, aVDev.DrawGradient( rPolyPoly, rGrad ); aGradMtf.Stop(); - int i, nAct( aGradMtf.GetActionCount() ); - for( i=0; i<nAct; ++i ) + size_t i, nAct( aGradMtf.GetActionSize() ); + for( i=0; i < nAct; ++i ) { - MetaAction* pMetaAct = aGradMtf.GetAction(i); + MetaAction* pMetaAct = aGradMtf.GetAction( i ); pMetaAct->Duplicate(); rMtf.AddAction( pMetaAct ); } @@ -1226,7 +1340,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) Point aRotAnchor( aOrigin ); Size aRotOffset( aOffset ); - for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() ) + for( MetaAction* pAction = FirstAction(); pAction; pAction = NextAction() ) { const sal_uInt16 nActionType = pAction->GetType(); @@ -1440,7 +1554,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) if( pCommentAct->GetComment().Equals( "XGRAD_SEQ_BEGIN" ) ) { int nBeginComments( 1 ); - pAction = (MetaAction*) Next(); + pAction = NextAction(); // skip everything, except gradientex action while( pAction ) @@ -1475,7 +1589,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) } - pAction = (MetaAction*) Next(); + pAction =NextAction(); } } else @@ -1699,7 +1813,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference ) Rectangle aBound; - for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() ) + for( MetaAction* pAction = FirstAction(); pAction; pAction = NextAction() ) { const sal_uInt16 nActionType = pAction->GetType(); @@ -2226,7 +2340,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol aMtf.aPrefSize = aPrefSize; aMtf.aPrefMapMode = aPrefMapMode; - for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() ) + for( MetaAction* pAction = FirstAction(); pAction; pAction = NextAction() ) { const sal_uInt16 nType = pAction->GetType(); @@ -2235,7 +2349,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_PIXEL_ACTION ): { MetaPixelAction* pAct = (MetaPixelAction*) pAction; - aMtf.Insert( new MetaPixelAction( pAct->GetPoint(), pFncCol( pAct->GetColor(), pColParam ) ), LIST_APPEND ); + aMtf.push_back( new MetaPixelAction( pAct->GetPoint(), pFncCol( pAct->GetColor(), pColParam ) ) ); } break; @@ -2248,7 +2362,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol else pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True ); - aMtf.Insert( pAct, LIST_APPEND ); + aMtf.push_back( pAct ); } break; @@ -2261,14 +2375,14 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol else pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True ); - aMtf.Insert( pAct, LIST_APPEND ); + aMtf.push_back( pAct ); } break; case( META_TEXTCOLOR_ACTION ): { MetaTextColorAction* pAct = (MetaTextColorAction*) pAction; - aMtf.Insert( new MetaTextColorAction( pFncCol( pAct->GetColor(), pColParam ) ), LIST_APPEND ); + aMtf.push_back( new MetaTextColorAction( pFncCol( pAct->GetColor(), pColParam ) ) ); } break; @@ -2281,7 +2395,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol else pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True ); - aMtf.Insert( pAct, LIST_APPEND ); + aMtf.push_back( pAct ); } break; @@ -2294,7 +2408,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol else pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True ); - aMtf.Insert( pAct, LIST_APPEND ); + aMtf.push_back( pAct ); } break; @@ -2307,7 +2421,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol else pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True ); - aMtf.Insert( pAct, LIST_APPEND ); + aMtf.push_back( pAct ); } break; @@ -2318,7 +2432,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol aFont.SetColor( pFncCol( aFont.GetColor(), pColParam ) ); aFont.SetFillColor( pFncCol( aFont.GetFillColor(), pColParam ) ); - aMtf.Insert( new MetaFontAction( aFont ), LIST_APPEND ); + aMtf.push_back( new MetaFontAction( aFont ) ); } break; @@ -2342,7 +2456,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol aWall.SetGradient( aGradient ); } - aMtf.Insert( new MetaWallpaperAction( rRect, aWall ), LIST_APPEND ); + aMtf.push_back( new MetaWallpaperAction( rRect, aWall ) ); } break; @@ -2357,59 +2471,58 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_BMPSCALE_ACTION ): { MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; - aMtf.Insert( new MetaBmpScaleAction( pAct->GetPoint(), pAct->GetSize(), - pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ), - LIST_APPEND ); + aMtf.push_back( new MetaBmpScaleAction( pAct->GetPoint(), pAct->GetSize(), + pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ) ); } break; case( META_BMPSCALEPART_ACTION ): { MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; - aMtf.Insert( new MetaBmpScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), - pAct->GetSrcPoint(), pAct->GetSrcSize(), - pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ), - LIST_APPEND ); + aMtf.push_back( new MetaBmpScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), + pAct->GetSrcPoint(), pAct->GetSrcSize(), + pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ) + ); } break; case( META_BMPEXSCALE_ACTION ): { MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; - aMtf.Insert( new MetaBmpExScaleAction( pAct->GetPoint(), pAct->GetSize(), - pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ), - LIST_APPEND ); + aMtf.push_back( new MetaBmpExScaleAction( pAct->GetPoint(), pAct->GetSize(), + pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ) + ); } break; case( META_BMPEXSCALEPART_ACTION ): { MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; - aMtf.Insert( new MetaBmpExScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), - pAct->GetSrcPoint(), pAct->GetSrcSize(), - pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ), - LIST_APPEND ); + aMtf.push_back( new MetaBmpExScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), + pAct->GetSrcPoint(), pAct->GetSrcSize(), + pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ) + ); } break; case( META_MASKSCALE_ACTION ): { MetaMaskScaleAction* pAct = (MetaMaskScaleAction*) pAction; - aMtf.Insert( new MetaMaskScaleAction( pAct->GetPoint(), pAct->GetSize(), - pAct->GetBitmap(), - pFncCol( pAct->GetColor(), pColParam ) ), - LIST_APPEND ); + aMtf.push_back( new MetaMaskScaleAction( pAct->GetPoint(), pAct->GetSize(), + pAct->GetBitmap(), + pFncCol( pAct->GetColor(), pColParam ) ) + ); } break; case( META_MASKSCALEPART_ACTION ): { MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction; - aMtf.Insert( new MetaMaskScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), - pAct->GetSrcPoint(), pAct->GetSrcSize(), - pAct->GetBitmap(), - pFncCol( pAct->GetColor(), pColParam ) ), - LIST_APPEND ); + aMtf.push_back( new MetaMaskScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), + pAct->GetSrcPoint(), pAct->GetSrcSize(), + pAct->GetBitmap(), + pFncCol( pAct->GetColor(), pColParam ) ) + ); } break; @@ -2420,7 +2533,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) ); aGradient.SetEndColor( pFncCol( aGradient.GetEndColor(), pColParam ) ); - aMtf.Insert( new MetaGradientAction( pAct->GetRect(), aGradient ), LIST_APPEND ); + aMtf.push_back( new MetaGradientAction( pAct->GetRect(), aGradient ) ); } break; @@ -2431,7 +2544,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) ); aGradient.SetEndColor( pFncCol( aGradient.GetEndColor(), pColParam ) ); - aMtf.Insert( new MetaGradientExAction( pAct->GetPolyPolygon(), aGradient ), LIST_APPEND ); + aMtf.push_back( new MetaGradientExAction( pAct->GetPolyPolygon(), aGradient ) ); } break; @@ -2441,7 +2554,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol Hatch aHatch( pAct->GetHatch() ); aHatch.SetColor( pFncCol( aHatch.GetColor(), pColParam ) ); - aMtf.Insert( new MetaHatchAction( pAct->GetPolyPolygon(), aHatch ), LIST_APPEND ); + aMtf.push_back( new MetaHatchAction( pAct->GetPolyPolygon(), aHatch ) ); } break; @@ -2451,10 +2564,10 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() ); aTransMtf.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam ); - aMtf.Insert( new MetaFloatTransparentAction( aTransMtf, - pAct->GetPoint(), pAct->GetSize(), - pAct->GetGradient() ), - LIST_APPEND ); + aMtf.push_back( new MetaFloatTransparentAction( aTransMtf, + pAct->GetPoint(), pAct->GetSize(), + pAct->GetGradient() ) + ); } break; @@ -2464,9 +2577,9 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol GDIMetaFile aSubst( pAct->GetSubstitute() ); aSubst.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam ); - aMtf.Insert( new MetaEPSAction( pAct->GetPoint(), pAct->GetSize(), - pAct->GetLink(), aSubst ), - LIST_APPEND ); + aMtf.push_back( new MetaEPSAction( pAct->GetPoint(), pAct->GetSize(), + pAct->GetLink(), aSubst ) + ); } break; @@ -2475,14 +2588,14 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol OSL_TRACE( "ExchangeColors not supported for RenderGraphic MetaActions yet" ); pAction->Duplicate(); - aMtf.Insert( pAction, LIST_APPEND ); + aMtf.push_back( pAction ); } break; default: { pAction->Duplicate(); - aMtf.Insert( pAction, LIST_APPEND ); + aMtf.push_back( pAction ); } break; } @@ -2670,8 +2783,7 @@ sal_uLong GDIMetaFile::GetChecksum() const sal_uLong nCrc = 0; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet(); - - for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ ) + for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; i++ ) { MetaAction* pAction = GetAction( i ); @@ -2970,7 +3082,7 @@ sal_uLong GDIMetaFile::GetSizeBytes() const { sal_uLong nSizeBytes = 0; - for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i ) + for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; ++i ) { MetaAction* pAction = GetAction( i ); @@ -3210,7 +3322,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm, GDIMetaFileWriteFlags nWriteFlags // additional RenderGraphic replacement actions, if the // GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC is set // and META_RENDERGRAPHIC_ACTION are encountered (KA 01/2011) - for( MetaAction* pAct = static_cast< MetaAction* >( First() ); pAct; pAct = static_cast< MetaAction* >( Next() ) ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { nActionCount += ( bRenderGraphicReplacements && ( META_RENDERGRAPHIC_ACTION == pAct->GetType() ) ? 2 : 1 ); } @@ -3235,7 +3347,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm, GDIMetaFileWriteFlags nWriteFlags aWriteData.meActualCharSet = rOStm.GetStreamCharSet(); aWriteData.mnWriteFlags = nWriteFlags; - for( MetaAction* pAct = static_cast< MetaAction* >( First() ); pAct; pAct = static_cast< MetaAction* >( Next() ) ) + for( MetaAction* pAct = FirstAction(); pAct; pAct = NextAction() ) { pAct->Write( rOStm, &aWriteData ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 84e962bd2f6e..9d995f361329 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -486,7 +486,7 @@ sal_Bool ImpGraphic::ImplIsAnimated() const sal_Bool ImpGraphic::ImplIsEPS() const { return( ( meType == GRAPHIC_GDIMETAFILE ) && - ( maMetaFile.GetActionCount() > 0 ) && + ( maMetaFile.GetActionSize() > 0 ) && ( maMetaFile.GetAction( 0 )->GetType() == META_EPS_ACTION ) ); } @@ -495,7 +495,7 @@ sal_Bool ImpGraphic::ImplIsEPS() const sal_Bool ImpGraphic::ImplIsRenderGraphic() const { return( ( GRAPHIC_GDIMETAFILE == meType ) && - ( 1 == maMetaFile.GetActionCount() ) && + ( 1 == maMetaFile.GetActionSize() ) && ( META_RENDERGRAPHIC_ACTION == maMetaFile.GetAction( 0 )->GetType() ) ); } diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 21c0cbb0abd4..19dc306ca4d6 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -820,7 +820,7 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM delete[] (sal_uInt8*) pColorSet; - if( rMtf.GetActionCount() ) + if( rMtf.GetActionSize() ) { MapMode aMap( MAP_100TH_MM ); VirtualDevice aVDev; diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx index 4d87c06471ee..ecba7a97880b 100644 --- a/vcl/source/gdi/oldprintadaptor.cxx +++ b/vcl/source/gdi/oldprintadaptor.cxx @@ -63,6 +63,7 @@ OldStylePrintAdaptor::OldStylePrintAdaptor( const boost::shared_ptr< Printer >& OldStylePrintAdaptor::~OldStylePrintAdaptor() { + delete mpData; } void OldStylePrintAdaptor::StartPage() diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index 6bbaec8e43f5..3e5e05904e57 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -995,7 +995,7 @@ void OutputDevice::ImplInitClipRegion() && GetOutDevType() != OUTDEV_PRINTER ); if( bClipDeviceBounds ) { - // #b6520266# Perform actual rect clip against outdev + // Perform actual rect clip against outdev // dimensions, to generate empty clips whenever one of the // values is completely off the device. Rectangle aDeviceBounds( mnOutOffX, mnOutOffY, diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index f5b493b7db4f..31ef2c5a8250 100755 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -90,8 +90,6 @@ #if defined UNX #define GLYPH_FONT_HEIGHT 128 -#elif defined OS2 -#define GLYPH_FONT_HEIGHT 176 #else #define GLYPH_FONT_HEIGHT 256 #endif @@ -520,7 +518,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang, MsLangId::convertLanguageToLocale( eLang, aLocale ); } - utl::DefaultFontConfiguration& rDefaults = *utl::DefaultFontConfiguration::get(); + utl::DefaultFontConfiguration& rDefaults = utl::DefaultFontConfiguration::get(); String aSearch = rDefaults.getUserInterfaceFont( aLocale ); // ensure a fallback String aDefault = rDefaults.getDefaultFont( aLocale, nType ); if( aDefault.Len() ) @@ -1673,7 +1671,7 @@ void ImplDevFontList::InitMatchData() const mbMatchData = true; // calculate MatchData for all entries - const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get(); + const FontSubstConfiguration& rFontSubst = FontSubstConfiguration::get(); DevFontList::const_iterator it = maDevFontList.begin(); for(; it != maDevFontList.end(); ++it ) @@ -1689,7 +1687,7 @@ void ImplDevFontList::InitMatchData() const ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const { // get the default font for a specified locale - const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get(); + const DefaultFontConfiguration& rDefaults = DefaultFontConfiguration::get(); const String aDefault = rDefaults.getUserInterfaceFont( rLocale ); ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault ); if( pFontData ) @@ -2065,7 +2063,7 @@ ImplDevFontListData* ImplDevFontList::FindDefaultFont() const { // try to find one of the default fonts of the // UNICODE, SANSSERIF, SERIF or FIXED default font lists - const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get(); + const DefaultFontConfiguration& rDefaults = DefaultFontConfiguration::get(); com::sun::star::lang::Locale aLocale( OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), OUString(), OUString() ); String aFontname = rDefaults.getDefaultFont( aLocale, DEFAULTFONT_SANS_UNICODE ); ImplDevFontListData* pFoundData = ImplFindByTokenNames( aFontname ); @@ -2599,7 +2597,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, { // get fallback info using FontSubstConfiguration and // the target name, it's shortened name and family name in that order - const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get(); + const FontSubstConfiguration& rFontSubst = FontSubstConfiguration::get(); pFontAttr = rFontSubst.getSubstInfo( aSearchName ); if ( !pFontAttr && (aSearchShortName != aSearchName) ) pFontAttr = rFontSubst.getSubstInfo( aSearchShortName ); @@ -2619,7 +2617,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, if( rFSD.IsSymbolFont() ) { com::sun::star::lang::Locale aDefaultLocale( OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), OUString(), OUString() ); - aSearchName = DefaultFontConfiguration::get()->getDefaultFont( aDefaultLocale, DEFAULTFONT_SYMBOL ); + aSearchName = DefaultFontConfiguration::get().getDefaultFont( aDefaultLocale, DEFAULTFONT_SYMBOL ); ImplDevFontListData* pFoundData = ImplFindByTokenNames( aSearchName ); if( pFoundData ) return pFoundData; @@ -2655,7 +2653,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, // get fallback info using FontSubstConfiguration and // the target name, it's shortened name and family name in that order - const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get(); + const FontSubstConfiguration& rFontSubst = FontSubstConfiguration::get(); const FontNameAttr* pTempFontAttr = rFontSubst.getSubstInfo( aSearchName ); if ( !pTempFontAttr && (aTempShortName != aSearchName) ) pTempFontAttr = rFontSubst.getSubstInfo( aTempShortName ); @@ -6140,7 +6138,7 @@ void OutputDevice::forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &r if (fScale < 1) { long nOrigHeight = rFontSelData.mnHeight; - rFontSelData.mnHeight *= fScale; + rFontSelData.mnHeight = static_cast<int>(static_cast<float>(rFontSelData.mnHeight) * fScale); rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel ); rFontSelData.mnHeight = nOrigHeight; } diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx index 2bdc4f84fb7b..52500a53e24f 100644 --- a/vcl/source/gdi/outdevnative.cxx +++ b/vcl/source/gdi/outdevnative.cxx @@ -237,7 +237,7 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType, if ( mbInitClipRegion ) ImplInitClipRegion(); - if ( mbOutputClipped || rControlRegion.IsEmpty() ) + if ( mbOutputClipped ) return sal_True; if ( mbInitLineColor ) diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index dd69e74d80fb..a7e138361200 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -1863,9 +1863,9 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion, #define ENTER3( eUnitSource, eUnitDest ) \ long nNumerator = 1; \ long nDenominator = 1; \ - DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit"); \ - DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit"); \ - if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) ) \ + DBG_ASSERT( eUnitSource <= MAP_PIXEL, "nonpermitted source map unit"); \ + DBG_ASSERT( eUnitDest <= MAP_PIXEL, "nonpermitted destination map unit"); \ + if( (eUnitSource <= MAP_PIXEL) && (eUnitDest <= MAP_PIXEL) ) \ { \ nNumerator = aImplNumeratorAry[eUnitSource] * \ aImplDenominatorAry[eUnitDest]; \ diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 2736e321ea80..868163d5ded8 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -327,7 +327,7 @@ void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDa PDFExtOutDevDataSync aSync; aSync.eAct = eAct; if ( pMtf ) - aSync.nIdx = pMtf->GetActionCount(); + aSync.nIdx = pMtf->GetActionSize(); else aSync.nIdx = 0x7fffffff; // sync not possible mActions.push_back( aSync ); diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index 244620bdafd5..481ad2be3aa4 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -430,7 +430,6 @@ sal_Int32 PDFWriter::CreateNamedDest( const rtl::OUString& sDestName, const Rect { return ((PDFWriterImpl*)pImplementation)->createNamedDest( sDestName, rRect, nPageNr, eType ); } -//<--- sal_Int32 PDFWriter::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) { return ((PDFWriterImpl*)pImplementation)->createDest( rRect, nPageNr, eType ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 8bab1abf6d47..91aec0e83ba5 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3370,9 +3370,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont throw FontException(); // nLength3 is the rest of the file - excluding any section headers - // nIndex now points to the first of the 512 '0' characters marking the + // nIndex now points before the first of the 512 '0' characters marking the // fixed content portion - sal_Int32 nLength3 = nFontLen - nIndex; + sal_Int32 nLength3 = nFontLen - nIndex - 1; for( it = aSections.begin(); it != aSections.end(); ++it ) { if( *it >= nIndex ) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index d6f87f83a006..8649beff6ceb 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -386,7 +386,6 @@ public: PDFWriter::DestAreaType m_eType; Rectangle m_aRect; }; -//<--- struct PDFOutlineEntry { @@ -610,7 +609,6 @@ private: destination id is always the destination's position in this vector */ std::vector<PDFNamedDest> m_aNamedDests; - //<--- /* contains all dests ever set during the PDF creation, dest id is always the dest's position in this vector */ diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index eae543b1b65d..17b684e6a675 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -268,7 +268,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa } GDIMetaFile aMtf( i_rMtf ); - for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; ) + for( sal_uInt32 i = 0, nCount = aMtf.GetActionSize(); i < (sal_uInt32)nCount; ) { if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) ) { diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 66e3cd1bea1a..cd47967f760e 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -404,7 +404,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) sal_uInt32 nYPixelPerMeter = ImplReadsal_uInt32(); sal_uInt8 nUnitSpecifier = *maDataIter++; - if( (nUnitSpecifier == 1) && nXPixelPerMeter && nXPixelPerMeter ) + if( (nUnitSpecifier == 1) && nXPixelPerMeter && nYPixelPerMeter ) { mbpHYs = sal_True; diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index b87457c35054..35c0e13908dd 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -186,7 +186,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx, ImplWriteTransparent(); ImplWriteIDAT(); } - aBmp.ReleaseAccess( mpAccess ); + aBmp.ReleaseAccess( mpAccess ), mpAccess = 0; } else mbStatus = sal_False; @@ -207,7 +207,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx, ImplWritepHYs( rBmpEx ); ImplWriteIDAT(); } - aMask.ReleaseAccess( mpMaskAccess ); + aMask.ReleaseAccess( mpMaskAccess ), mpMaskAccess = 0; } else mbStatus = sal_False; @@ -223,12 +223,12 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx, ImplWritepHYs( rBmpEx ); ImplWriteIDAT(); } - aMask.ReleaseAccess( mpMaskAccess ); + aMask.ReleaseAccess( mpMaskAccess ), mpMaskAccess = 0; } else mbStatus = sal_False; } - aBmp.ReleaseAccess( mpAccess ); + aBmp.ReleaseAccess( mpAccess ), mpAccess = 0; } else mbStatus = sal_False; @@ -247,7 +247,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx, ImplWriteIDAT(); } - aBmp.ReleaseAccess( mpAccess ); + aBmp.ReleaseAccess( mpAccess ), mpAccess = 0; } else mbStatus = sal_False; diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 5a23eb406bc3..add5071ef2dd 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1140,7 +1140,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, // settings for all cases. // maps mtf actions to CC list entries - ::std::vector< const ConnectedComponents* > aCCList_MemberMap( rInMtf.GetActionCount() ); + ::std::vector< const ConnectedComponents* > aCCList_MemberMap( rInMtf.GetActionSize() ); // iterate over all aCCList members and their contained metaactions ConnectedComponentsList::iterator aCurr( aCCList.begin() ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 0e99923ccc0f..61a40af43bdd 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -250,7 +250,7 @@ static rtl::OUString queryFile( Printer* pPrinter ) // add arbitrary files xFilterMgr->appendFilter( String( VclResId( SV_STDTEXT_ALLFILETYPES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) ); } - catch( lang::IllegalArgumentException rExc ) + catch( lang::IllegalArgumentException ) { DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" ); } diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx index 21c82cd51f3a..1cec295bda93 100644 --- a/vcl/source/gdi/regband.cxx +++ b/vcl/source/gdi/regband.cxx @@ -166,7 +166,7 @@ void ImplRegionBand::ProcessPoints() while ( pRegionBandPoint ) { // within list? - if ( pRegionBandPoint && pRegionBandPoint->mpNextBandPoint ) + if ( pRegionBandPoint->mpNextBandPoint ) { // start/stop? if ( pRegionBandPoint->mbEndPoint && pRegionBandPoint->mpNextBandPoint->mbEndPoint ) diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index b92deb89a928..79bcb608fb5f 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -630,7 +630,7 @@ long FreetypeManager::AddFontDir( const String& rUrlName ) rtl_TextEncoding theEncoding = osl_getThreadTextEncoding(); while( (rcOSL = aDir.getNextItem( aDirItem, 20 )) == osl::FileBase::E_None ) { - osl::FileStatus aFileStatus( FileStatusMask_FileURL ); + osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileURL ); rcOSL = aDirItem.getFileStatus( aFileStatus ); ::rtl::OUString aUSytemPath; @@ -2430,7 +2430,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) sal_uLong nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys? // TODO: request more features depending on script and language system - if( aReqFeatureTagList.size() == 0) // nothing to do + if( aReqFeatureTagList.empty()) // nothing to do return true; // load GSUB table into memory @@ -2510,7 +2510,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) } } - if( !aFeatureIndexList.size() ) + if( aFeatureIndexList.empty() ) return true; UshortList aLookupIndexList; diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx index e5624b2910c1..311654586596 100644 --- a/vcl/source/glyphs/gcach_layout.cxx +++ b/vcl/source/glyphs/gcach_layout.cxx @@ -553,7 +553,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr { if ( j == nRawRunGlyphCount ) { - nNewWidth = pNextPos->fX - pPos->fX; + nNewWidth = static_cast<int>(pNextPos->fX - pPos->fX); break; } @@ -566,7 +566,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr int nNextGlyphWidth = rNextGM.GetCharWidth(); if ( nNextGlyphWidth > 0 ) { - nNewWidth = pNextPos->fX - pPos->fX; + nNewWidth = static_cast<int>(pNextPos->fX - pPos->fX); break; } } diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 44fab8c7a3e7..46de93aaac39 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -658,7 +658,7 @@ bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr_segment * pSegment) mvCharDxs[mvCharDxs.size() - 1] = mnWidth; } } - catch (std::exception e) + catch (std::exception &e) { #ifdef GRLAYOUT_DEBUG fprintf(grLog(),"LayoutGlyphs failed %s\n", e.what()); diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index 930be4d27931..ac8e658f7bd8 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -220,8 +220,8 @@ namespace vcl sal_Int32 nHeight, const rendering::IntegerBitmapLayout& rLayout, const uno::Reference< rendering::XIntegerReadOnlyBitmap >& xInputBitmap, - ScopedBitmapWriteAccess& rWriteAcc, - ScopedBitmapWriteAccess& rAlphaAcc ) + Bitmap::ScopedWriteAccess& rWriteAcc, + Bitmap::ScopedWriteAccess& rAlphaAcc ) { rendering::IntegerBitmapLayout aCurrLayout; geometry::IntegerRectangle2D aRect; @@ -433,9 +433,8 @@ namespace vcl sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) ); { // limit scoped access - ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), - aBitmap ); - ScopedBitmapWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL, + Bitmap::ScopedWriteAccess pWriteAccess( aBitmap ); + Bitmap::ScopedWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL, aAlpha ); ENSURE_OR_THROW(pWriteAccess.get() != NULL, diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src index 44561a89f513..c0303aac0f1f 100644 --- a/vcl/source/src/btntext.src +++ b/vcl/source/src/btntext.src @@ -66,7 +66,7 @@ String SV_BUTTONTEXT_MORE String SV_BUTTONTEXT_LESS { - Text [ en-US ] = "~More"; + Text [ en-US ] = "~Less"; }; String SV_BUTTONTEXT_IGNORE diff --git a/vcl/source/src/units.src b/vcl/source/src/units.src index 57025c9b2a2f..24023569aaeb 100644 --- a/vcl/source/src/units.src +++ b/vcl/source/src/units.src @@ -40,7 +40,7 @@ StringArray SV_FUNIT_STRINGS < "twips" ; FUNIT_TWIP ; > ; < "twip" ; FUNIT_TWIP ; > ; < "pt" ; FUNIT_POINT ; > ; - < "pi" ; FUNIT_PICA ; > ; + < "pc" ; FUNIT_PICA ; > ; < "\"" ; FUNIT_INCH ; > ; < "in" ; FUNIT_INCH ; > ; < "inch" ; FUNIT_INCH ; > ; diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index a07c0ee17b28..525c8ad5a76a 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -119,7 +119,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) do { nIndex++; - ImplAccelEntry* pTempEntry = (*pList)[ nIndex ]; + ImplAccelEntry* pTempEntry = NULL; + if ( nIndex < pList->size() ) + pTempEntry = (*pList)[ nIndex ]; if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) ) break; } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 26397d7adf7f..d048b3ab6fba 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -373,9 +373,9 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, { pData->maMouseOff = rMEvt.GetPosPixel(); pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff ); - sal_uInt16 nDragFullTest = 0; if ( pData->mnHitTest ) { + sal_uInt16 nDragFullTest = 0; sal_Bool bTracking = sal_True; sal_Bool bHitTest = sal_True; diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 6cecea6a24a7..89bfe4f2d067 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -52,7 +52,7 @@ struct ImplCursorData short mnOrientation; // Pixel-Orientation unsigned char mnDirection; // indicates writing direction sal_uInt16 mnStyle; // Cursor-Style - sal_Bool mbCurVisible; // Ist Cursor aktuell sichtbar + bool mbCurVisible; // Ist Cursor aktuell sichtbar Window* mpWindow; // Zugeordnetes Windows }; @@ -61,8 +61,8 @@ struct ImplCursorData static void ImplCursorInvert( ImplCursorData* pData ) { Window* pWindow = pData->mpWindow; - sal_Bool bMapMode = pWindow->IsMapModeEnabled(); - pWindow->EnableMapMode( sal_False ); + bool bMapMode = pWindow->IsMapModeEnabled(); + pWindow->EnableMapMode( false ); sal_uInt16 nInvertStyle; if ( pData->mnStyle & CURSOR_SHADOW ) nInvertStyle = INVERT_50; @@ -158,7 +158,7 @@ void Cursor::ImplDraw() // Ausgabeflaeche berechnen und ausgeben ImplCursorInvert( mpData ); - mpData->mbCurVisible = sal_True; + mpData->mbCurVisible = true; } } @@ -169,13 +169,11 @@ void Cursor::ImplRestore() if ( mpData && mpData->mbCurVisible ) { ImplCursorInvert( mpData ); - mpData->mbCurVisible = sal_False; + mpData->mbCurVisible = false; } } -// ----------------------------------------------------------------------- - -void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) +void Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) { if ( mbVisible ) { @@ -197,7 +195,7 @@ void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) if ( !mpData ) { mpData = new ImplCursorData; - mpData->mbCurVisible = sal_False; + mpData->mbCurVisible = false; mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, ImplTimerHdl ) ); } @@ -218,9 +216,7 @@ void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) } } -// ----------------------------------------------------------------------- - -bool Cursor::ImplHide( bool i_bStopTimer ) +bool Cursor::ImplDoHide( bool bSuspend ) { bool bWasCurVisible = false; if ( mpData && mpData->mpWindow ) @@ -228,18 +224,35 @@ bool Cursor::ImplHide( bool i_bStopTimer ) bWasCurVisible = mpData->mbCurVisible; if ( mpData->mbCurVisible ) ImplRestore(); - } - if( mpData && i_bStopTimer ) - { - mpData->maTimer.Stop(); - mpData->mpWindow = NULL; + if ( !bSuspend ) + { + mpData->maTimer.Stop(); + mpData->mpWindow = NULL; + } } - return bWasCurVisible; } -// ----------------------------------------------------------------------- +void Cursor::ImplShow( bool bDrawDirect ) +{ + ImplDoShow( bDrawDirect, false ); +} + +void Cursor::ImplHide() +{ + ImplDoHide( false ); +} + +void Cursor::ImplResume( bool bRestore ) +{ + ImplDoShow( false, bRestore ); +} + +bool Cursor::ImplSuspend() +{ + return ImplDoHide( true ); +} void Cursor::ImplNew() { @@ -279,7 +292,7 @@ Cursor::Cursor() mnOrientation = 0; mnDirection = 0; mnStyle = 0; - mbVisible = sal_False; + mbVisible = false; } // ----------------------------------------------------------------------- @@ -327,7 +340,7 @@ void Cursor::Show() { if ( !mbVisible ) { - mbVisible = sal_True; + mbVisible = true; ImplShow(); } } @@ -338,8 +351,8 @@ void Cursor::Hide() { if ( mbVisible ) { - mbVisible = sal_False; - ImplHide( true ); + mbVisible = false; + ImplHide(); } } @@ -459,17 +472,16 @@ Cursor& Cursor::operator=( const Cursor& rCursor ) // ----------------------------------------------------------------------- -sal_Bool Cursor::operator==( const Cursor& rCursor ) const +bool Cursor::operator==( const Cursor& rCursor ) const { - if ( (maPos == rCursor.maPos) && + return + ((maPos == rCursor.maPos) && (maSize == rCursor.maSize) && (mnSlant == rCursor.mnSlant) && (mnOrientation == rCursor.mnOrientation) && (mnDirection == rCursor.mnDirection) && - (mbVisible == rCursor.mbVisible) ) - return sal_True; - else - return sal_False; + (mbVisible == rCursor.mbVisible)) + ; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx index 54013a9bca03..977e8611e70a 100644 --- a/vcl/source/window/dndlcon.cxx +++ b/vcl/source/window/dndlcon.cxx @@ -194,7 +194,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } @@ -254,7 +254,7 @@ sal_uInt32 DNDListenerContainer::fireDragExitEvent() } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } @@ -306,7 +306,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } @@ -374,7 +374,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } @@ -441,7 +441,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } @@ -503,7 +503,7 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_ } } - catch( RuntimeException exc ) + catch( RuntimeException ) { pContainer->removeInterface( xElement ); } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 624a42593b07..6186514d2b88 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -369,7 +369,7 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const Window if( (*p)->mpDockingWindow == pWindow ) return (*p); else - p++; + ++p; } return NULL; } @@ -483,7 +483,7 @@ void DockingManager::RemoveWindow( const Window *pWindow ) break; } else - p++; + ++p; } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index af79642516f4..d4e16ed6c121 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -103,35 +103,6 @@ DBG_NAME( Menu ) // document closer #define IID_DOCUMENTCLOSE 1 -#ifdef OS2 - -#include <xwphook.h> - -// return sal_True if hilite should be executed: left mouse button down -// or xwp mouse hook enabled -static sal_Bool ImplHilite( const MouseEvent& rMEvt ) -{ - static sal_Bool init = sal_False; - static HOOKCONFIG hc; - - // read XWP settings at program startup - if (init == sal_False) { - sal_Bool rc; - sal_uLong cb = sizeof(HOOKCONFIG); - memset(&hc, 0, sizeof(HOOKCONFIG)); - rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG, - &hc, &cb); - init = sal_True; - } - // check mouse left button - if (rMEvt.GetButtons() == MOUSE_LEFT) - return sal_True; - // return xwp flag - return hc.fSlidingMenus; -} - -#endif - static sal_Bool ImplAccelDisabled() { // display of accelerator strings may be suppressed via configuration @@ -2306,6 +2277,37 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight; } +sal_Bool Menu::ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const +{ + ImplControlValue aVal; + Rectangle aNativeBounds; + Rectangle aNativeContent; + Point tmp( 0, 0 ); + Rectangle aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) ); + if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, + PART_MENU_SUBMENU_ARROW ) ) + { + if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), + ControlPart(PART_MENU_SUBMENU_ARROW), + aCtrlRegion, + ControlState(CTRL_STATE_ENABLED), + aVal, + OUString(), + aNativeBounds, + aNativeContent ) + ) + { + Size aSize( Size ( aNativeContent.GetWidth(), + aNativeContent.GetHeight() ) ); + rArrowSize = aSize; + rArrowSpacing = aNativeBounds.GetWidth() - aNativeContent.GetWidth(); + + return sal_True; + } + } + return sal_False; +} + // ----------------------------------------------------------------------- void Menu::ImplAddDel( ImplMenuDelData& rDel ) @@ -2854,21 +2856,57 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa // SubMenu? if ( !bLayout && !bIsMenuBar && pData->pSubMenu ) { - aTmpPos.X() = aOutSz.Width() - nFontHeight + nExtra - nOuterSpace; - aTmpPos.Y() = aPos.Y(); - aTmpPos.Y() += nExtra/2; - aTmpPos.Y() += ( pData->aSz.Height() / 2 ) - ( nFontHeight/4 ); - if ( pData->nBits & MIB_POPUPSELECT ) + bool bNativeOk = false; + if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, + PART_MENU_SUBMENU_ARROW ) ) + { + ControlState nState = 0; + Size aTmpSz( 0, 0 ); + long aSpacing = 0; + + if( !ImplGetNativeSubmenuArrowSize( pWin, + aTmpSz, aSpacing ) ) + { + aTmpSz = Size( nFontHeight, nFontHeight ); + aSpacing = nOuterSpace; + } + + if ( pData->bEnabled ) + nState |= CTRL_STATE_ENABLED; + if ( bHighlighted ) + nState |= CTRL_STATE_SELECTED; + + aTmpPos.X() = aOutSz.Width() - aTmpSz.Width() - aSpacing - nOuterSpace; + aTmpPos.Y() = aPos.Y() + ( pData->aSz.Height() - aTmpSz.Height() ) / 2; + aTmpPos.Y() += nExtra/2; + + Rectangle aItemRect( aTmpPos, aTmpSz ); + MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect ); + bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, + PART_MENU_SUBMENU_ARROW, + aItemRect, + nState, + aVal, + OUString() ); + } + if( ! bNativeOk ) { - pWin->SetTextColor( rSettings.GetMenuTextColor() ); - Point aTmpPos2( aPos ); - aTmpPos2.X() = aOutSz.Width() - nFontHeight - nFontHeight/4; - aDecoView.DrawFrame( - Rectangle( aTmpPos2, Size( nFontHeight+nFontHeight/4, pData->aSz.Height() ) ), FRAME_DRAW_GROUP ); + aTmpPos.X() = aOutSz.Width() - nFontHeight + nExtra - nOuterSpace; + aTmpPos.Y() = aPos.Y(); + aTmpPos.Y() += nExtra/2; + aTmpPos.Y() += ( pData->aSz.Height() / 2 ) - ( nFontHeight/4 ); + if ( pData->nBits & MIB_POPUPSELECT ) + { + pWin->SetTextColor( rSettings.GetMenuTextColor() ); + Point aTmpPos2( aPos ); + aTmpPos2.X() = aOutSz.Width() - nFontHeight - nFontHeight/4; + aDecoView.DrawFrame( + Rectangle( aTmpPos2, Size( nFontHeight+nFontHeight/4, pData->aSz.Height() ) ), FRAME_DRAW_GROUP ); + } + aDecoView.DrawSymbol( + Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ), + SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); } - aDecoView.DrawSymbol( - Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ), - SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); } if ( pThisItemOnly && bHighlighted ) @@ -4499,10 +4537,6 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) if ( rMEvt.IsLeaveWindow() ) { -#ifdef OS2 - if ( ImplHilite(rMEvt) ) - { -#endif // #102461# do not remove highlight if a popup menu is open at this position MenuItemData* pData = pMenu ? pMenu->pItemList->GetDataFromPos( nHighlightedItem ) : NULL; // close popup with some delayed if we leave somewhere else @@ -4511,17 +4545,11 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) ) ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); -#ifdef OS2 - } -#endif if ( IsScrollMenu() ) ImplScroll( rMEvt.GetPosPixel() ); } else -#ifdef OS2 - if ( ImplHilite(rMEvt) ) -#endif { aSubmenuCloseTimer.Stop(); if( bIgnoreFirstMove ) @@ -5484,9 +5512,6 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt ) sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) -#ifdef OS2 - && ( ImplHilite(rMEvt) ) -#endif && ( nEntry != nHighlightedItem ) ) ChangeHighlightItem( nEntry, sal_False ); } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index a0160f78f287..36293298172c 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1079,7 +1079,6 @@ void PrintDialog::setupOptionalUI() Sequence< rtl::OUString > aHelpTexts; Sequence< rtl::OUString > aHelpIds; sal_Int64 nMinValue = 0, nMaxValue = 0; - sal_Int32 nCurHelpText = 0; rtl::OUString aGroupingHint; rtl::OUString aDependsOnName; sal_Int32 nDependsOnValue = 0; @@ -1356,6 +1355,7 @@ void PrintDialog::setupOptionalUI() } else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent ) { + sal_Int32 nCurHelpText = 0; boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn ); if( aText.getLength() ) { @@ -1535,7 +1535,11 @@ void PrintDialog::setupOptionalUI() } else { - OSL_FAIL( "Unsupported UI option" ); + rtl::OStringBuffer sMessage; + sMessage.append(RTL_CONSTASCII_STRINGPARAM("Unsupported UI option: \"")); + sMessage.append(rtl::OUStringToOString(aCtrlType, RTL_TEXTENCODING_UTF8)); + sMessage.append('"'); + OSL_FAIL( sMessage.getStr() ); } pCurColumn = pSaveCurColumn; diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 02be128cd8dd..9c0f4699baa8 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -99,7 +99,7 @@ struct ImplSplitSet size has not lower or upper bound. */ namespace { - long ValidateSize (const long nSize, const ImplSplitItem rItem) + long ValidateSize (const long nSize, const ImplSplitItem &rItem) { if (rItem.mnMinSize>=0 && nSize<rItem.mnMinSize) return rItem.mnMinSize; diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 9bdbfd970ed7..341d7f3bfff8 100755 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -255,9 +255,11 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) (void)bUseJava; #if defined WNT nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); + (void)bUseJava; #elif defined QUARTZ // FIXME: this is wrong nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); + (void)bUseJava; #elif defined UNX if( !bUseJava ) { diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 9f796269014f..24c8ded6e4b4 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -238,7 +238,7 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) return sal_True; } else - p++; + ++p; } // the focus is not in the list: activate first float if F6 was pressed diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 50137643a2cc..3e83a1711a24 100755 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -573,7 +573,7 @@ void ToolBox::ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegi { // just invalidate to trigger paint of the parent - const bool bOldPaintLock = pThis->mpData->mbIsPaintLocked; + const bool bOldPaintLock = pThis->mpData->mbIsPaintLocked; pThis->mpData->mbIsPaintLocked = true; // send an invalidate to the first opaque parent and invalidate the whole hierarchy from there (noclipchildren) @@ -1578,7 +1578,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) ImplGetWindowImpl()->mbToolBox = sal_True; mpBtnDev = NULL; mpFloatSizeAry = NULL; - mpData = new ImplToolBoxPrivateData; + mpData = new ImplToolBoxPrivateData; mpFloatWin = NULL; mnDX = 0; mnDY = 0; @@ -1597,7 +1597,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) mnCurItemId = 0; mnDownItemId = 0; mnCurPos = TOOLBOX_ITEM_NOTFOUND; - mnFocusPos = TOOLBOX_ITEM_NOTFOUND; // current position during keyboard access + mnFocusPos = TOOLBOX_ITEM_NOTFOUND; // current position during keyboard access mnLines = 1; mnCurLine = 1; mnCurLines = 1; @@ -1622,7 +1622,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) mbCustomizeMode = sal_False; mbDragging = sal_False; mbMenuStrings = sal_False; - mbIsShift = sal_False; + mbIsShift = sal_False; mbIsKeyEvent = sal_False; mbChangingHighlight = sal_False; meButtonType = BUTTON_SYMBOL; @@ -1630,7 +1630,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) meLastStyle = POINTER_ARROW; mnWinStyle = nStyle; mnLastFocusItemId = 0; - mnKeyModifier = 0; + mnKeyModifier = 0; mnActivateCount = 0; maTimer.SetTimeout( 50 ); @@ -2932,7 +2932,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG ) { // no floater was opened Deactivate(); - ImplDrawItem( mnCurPos, sal_False ); + ImplDrawItem( mnCurPos, 0 ); mnCurPos = TOOLBOX_ITEM_NOTFOUND; mnCurItemId = 0; @@ -3466,7 +3466,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 h ControlState nState = 0; if ( highlight == 1 ) nState |= CTRL_STATE_PRESSED; - if ( highlight == 2 ) nState |= CTRL_STATE_ROLLOVER; + if ( highlight == 2 ) nState |= CTRL_STATE_ROLLOVER; if ( bEnabled ) nState |= CTRL_STATE_ENABLED; aControlValue.setTristateVal( bChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); @@ -3480,7 +3480,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 h pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, sal_True, bIsWindow, 2, NULL, NULL ); } -void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPaint, sal_Bool bLayout ) +void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPaint, sal_Bool bLayout ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -3498,7 +3498,8 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL; String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL; - bHighlight = bHighlight && pItem->mbEnabled; + if(!pItem->mbEnabled) + nHighlight = 0; // Falls Rechteck ausserhalb des sichbaren Bereichs liegt if ( pItem->maRect.IsEmpty() ) @@ -3621,7 +3622,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain { nStyle |= BUTTON_DRAW_DONTKNOW; } - if ( bHighlight == 1 ) + if ( nHighlight == 1 ) { nStyle |= BUTTON_DRAW_PRESSED; } @@ -3630,7 +3631,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain { nOffX = OUTBUTTON_OFF_NORMAL_X; nOffY = OUTBUTTON_OFF_NORMAL_Y; - if ( bHighlight ) + if ( nHighlight != 0 ) { nOffX++; nOffY++; @@ -3643,7 +3644,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain { if ( (pItem->meState != STATE_NOCHECK) || !bPaint ) { - ImplErase( this, pItem->maRect, bHighlight, bHasOpenPopup ); + ImplErase( this, pItem->maRect, nHighlight != 0, bHasOpenPopup ); } } else @@ -3682,7 +3683,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain if ( bImage && ! bLayout ) { const Image* pImage; - if ( bHighlight && (!(pItem->maHighImage)) == sal_False ) + if ( (nHighlight != 0) && (!(pItem->maHighImage)) == sal_False ) pImage = &(pItem->maHighImage); else pImage = &(pItem->maImage); @@ -3716,14 +3717,14 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain nImageOffX += (nBtnWidth-aImageSize.Width())/2; nImageOffY += (nBtnHeight-aImageSize.Height())/2; } - if ( bHighlight || (pItem->meState == STATE_CHECK) ) + if ( nHighlight != 0 || (pItem->meState == STATE_CHECK) ) { if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); + ImplDrawButton( this, aButtonRect, nHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); - if( bHighlight ) + if( nHighlight != 0 ) { if( bHighContrastWhite ) nImageStyle |= IMAGE_DRAW_COLORTRANSFORM; @@ -3782,12 +3783,12 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain } // draw selection only if not already drawn during image output (see above) - if ( !bLayout && !bImage && (bHighlight || (pItem->meState == STATE_CHECK) ) ) + if ( !bLayout && !bImage && (nHighlight != 0 || (pItem->meState == STATE_CHECK) ) ) { if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); + ImplDrawButton( this, pItem->maRect, nHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); } sal_uInt16 nTextStyle = 0; @@ -3822,14 +3823,14 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain // dropdown only will be painted without inner border if( (pItem->mnBits & TIB_DROPDOWNONLY) != TIB_DROPDOWNONLY ) { - ImplErase( this, aDropDownRect, bHighlight, bHasOpenPopup ); + ImplErase( this, aDropDownRect, nHighlight != 0, bHasOpenPopup ); - if( bHighlight || (pItem->meState == STATE_CHECK) ) + if( nHighlight != 0 || (pItem->meState == STATE_CHECK) ) { if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False ); + ImplDrawButton( this, aDropDownRect, nHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False ); } } ImplDrawDropdownArrow( this, aDropDownRect, bSetColor, bRotate ); @@ -3940,7 +3941,7 @@ void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow ) mpFloatWin = pFloatWindow; // redraw item, to trigger drawing of a special border - ImplDrawItem( mnCurPos, sal_True ); + ImplDrawItem( mnCurPos, 1 ); mbDrag = sal_False; EndTracking(); @@ -4021,7 +4022,7 @@ sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat { if ( !mnCurItemId ) { - ImplDrawItem( mnCurPos, sal_True ); + ImplDrawItem( mnCurPos, 1 ); mnCurItemId = pItem->mnId; Highlight(); } @@ -4160,17 +4161,17 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa // Items nicht geloescht, im Select-Handler if ( mnCurItemId ) { - sal_Bool bHighlight; + sal_uInt16 nHighlight; if ( (mnCurItemId == mnHighItemId) && (mnOutStyle & TOOLBOX_STYLE_FLAT) ) - bHighlight = 2; + nHighlight = 2; else - bHighlight = sal_False; + nHighlight = 0; // Get current pos for the case that items are inserted/removed // in the toolBox mnCurPos = GetItemPos( mnCurItemId ); if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) { - ImplDrawItem( mnCurPos, bHighlight ); + ImplDrawItem( mnCurPos, nHighlight ); Flush(); } } @@ -4289,7 +4290,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) { mnCurItemId = mnHighItemId = it->mnId; - ImplDrawItem( mnCurPos, 2 /*sal_True*/ ); // always use shadow effect (2) + ImplDrawItem( mnCurPos, 2 ); // always use shadow effect (2) } else mnCurItemId = mnHighItemId = 0; @@ -4419,7 +4420,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) sal_uInt16 nClearPos = GetItemPos( mnHighItemId ); if ( nClearPos != TOOLBOX_ITEM_NOTFOUND ) { - ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? sal_True : sal_False ); + ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? 1 : 0 ); if( nClearPos != mnCurPos ) ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) ); } @@ -4531,7 +4532,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbSelection ) { - ImplDrawItem( mnCurPos, sal_True ); + ImplDrawItem( mnCurPos, 1 ); Highlight(); } else @@ -4548,7 +4549,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbDrag ) { - ImplDrawItem( mnCurPos, sal_True ); + ImplDrawItem( mnCurPos, 1 ); Highlight(); } @@ -4569,7 +4570,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) { // no floater was opened Deactivate(); - ImplDrawItem( mnCurPos, sal_False ); + ImplDrawItem( mnCurPos, 0 ); mnCurPos = TOOLBOX_ITEM_NOTFOUND; mnCurItemId = 0; @@ -4763,12 +4764,12 @@ void ToolBox::Paint( const Rectangle& rPaintRect ) // Nur malen, wenn Rechteck im PaintRectangle liegt if ( !pItem->maRect.IsEmpty() && rPaintRect.IsOver( pItem->maRect ) ) { - sal_Bool bHighlight = sal_False; + sal_uInt16 nHighlight = 0; if ( i == mnCurPos ) - bHighlight = 1; + nHighlight = 1; else if ( i == nHighPos ) - bHighlight = 2; - ImplDrawItem( i, bHighlight ); + nHighlight = 2; + ImplDrawItem( i, nHighlight ); } } ImplShowFocus(); @@ -6054,7 +6055,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus ) // which will in turn ImplShowFocus again // set mnHighItemId to 0 already to prevent this hen/egg problem mnHighItemId = 0; - ImplDrawItem( nPos, sal_False ); + ImplDrawItem( nPos, 0 ); ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) ); } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 832515e4c5ad..6da22a6207eb 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -327,7 +327,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl if ( !bUseSystemFont ) { ImplInitFontList(); - String aConfigFont = utl::DefaultFontConfiguration::get()->getUserInterfaceFont( rSettings.GetUILocale() ); + String aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILocale() ); xub_StrLen nIndex = 0; while( nIndex != STRING_NOTFOUND ) { @@ -2410,7 +2410,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) { bool bRestoreCursor = false; if ( mpWindowImpl->mpCursor ) - bRestoreCursor = mpWindowImpl->mpCursor->ImplHide( false ); + bRestoreCursor = mpWindowImpl->mpCursor->ImplSuspend(); mbInitClipRegion = sal_True; mpWindowImpl->mbInPaint = sal_True; @@ -2457,7 +2457,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) mbInitClipRegion = sal_True; mpWindowImpl->mpPaintRegion = NULL; if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( false, bRestoreCursor ); + mpWindowImpl->mpCursor->ImplResume( bRestoreCursor ); } } else @@ -2899,7 +2899,7 @@ void Window::ImplScroll( const Rectangle& rRect, ImplInvalidateAllOverlapBackgrounds(); if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplHide( false ); + mpWindowImpl->mpCursor->ImplSuspend(); sal_uInt16 nOrgFlags = nFlags; if ( !(nFlags & (SCROLL_CHILDREN | SCROLL_NOCHILDREN)) ) @@ -3046,7 +3046,7 @@ void Window::ImplScroll( const Rectangle& rRect, Update(); if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( false ); + mpWindowImpl->mpCursor->ImplResume(); } // ----------------------------------------------------------------------- @@ -4074,7 +4074,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags ) { // Cursor hiden if ( pOldFocusWindow->mpWindowImpl->mpCursor ) - pOldFocusWindow->mpWindowImpl->mpCursor->ImplHide( true ); + pOldFocusWindow->mpWindowImpl->mpCursor->ImplHide(); } // !!!!! Wegen altem SV-Office Activate/Deavtivate Handling @@ -4341,7 +4341,7 @@ Window::~Window() xComponent->dispose(); } - catch ( Exception exc ) + catch ( Exception ) { // can be safely ignored here. } @@ -6772,7 +6772,7 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin, if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), sal_True ) ) (*p)->EnableInput( bEnable, bChild ); } - p++; + ++p; } } } @@ -7912,7 +7912,7 @@ void Window::SetCursor( Cursor* pCursor ) if ( mpWindowImpl->mpCursor != pCursor ) { if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplHide( true ); + mpWindowImpl->mpCursor->ImplHide(); mpWindowImpl->mpCursor = pCursor; if ( pCursor ) pCursor->ImplShow(); @@ -8379,7 +8379,7 @@ uno::Reference< XDropTarget > Window::GetDropTarget() } - catch( RuntimeException exc ) + catch( RuntimeException ) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8452,7 +8452,7 @@ uno::Reference< XDragSource > Window::GetDragSource() } // createInstance can throw any exception - catch( Exception exc ) + catch( Exception ) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8532,7 +8532,7 @@ uno::Reference< XClipboard > Window::GetClipboard() } // createInstance can throw any exception - catch( Exception exc ) + catch( Exception ) { // release all instances mpWindowImpl->mpFrameData->mxClipboard.clear(); @@ -8584,7 +8584,7 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() } // createInstance can throw any exception - catch( Exception exc ) + catch( Exception ) { // release all instances mpWindowImpl->mpFrameData->mxSelection.clear(); diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 81acb8ebd4b7..2e52891d18fc 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1797,7 +1797,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG ) pSVData->maWinData.mpFocusWin = NULL; if ( pFocusWin->ImplGetWindowImpl()->mpCursor ) - pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide( true ); + pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide(); // Deaktivate rufen Window* pOldFocusWindow = pFocusWin; @@ -1904,7 +1904,7 @@ static void ImplHandleLoseFocus( Window* pWindow ) Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor ) - pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide( true ); + pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide(); if( bCallDirect ) pWindow->ImplAsyncFocusHdl( NULL ); } |