diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-11 10:53:35 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-11 10:53:35 +0000 |
commit | df3d827f86c0fb7a046175a1d2c8cc0a662fc4b3 (patch) | |
tree | e6ff3903eb20005d893732c909978f5e631b8c5e /vcl/source | |
parent | b8128f15549ddc463545f068d482a79bb3ef30f8 (diff) |
CWS-TOOLING: integrate CWS vcl98
2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc)
2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all
2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod)
2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod)
2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!)
2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686#
2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout
2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle
2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip
2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working
2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working
2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds
2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all
2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu
2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc)
2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions
2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions
2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel()
2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag
2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag
2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query
2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable
2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc)
2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version
2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE
2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning
2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!)
2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path
2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons
2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus
2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars
2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete
2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/cvtsvm.cxx | 23 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 17 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 62 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 6 | ||||
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 52 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 145 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 4 |
7 files changed, 180 insertions, 129 deletions
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 14c211e4e045..c1c02b673658 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -397,13 +397,8 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMod void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { - LineInfo aLineInfo( LINE_NONE, 0 ); - Stack aLIStack; - ULONG nPos = rIStm.Tell(); + const ULONG nPos = rIStm.Tell(); const USHORT nOldFormat = rIStm.GetNumberFormatInt(); - rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); - BOOL bFatLine = FALSE; - VirtualDevice aFontVDev; rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -412,14 +407,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) INT16 nSize; INT16 nVersion; - // Header lesen + // read header rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung rIStm >> nSize; // Size rIStm >> nVersion; // Version rIStm >> aPrefSz.Width(); // PrefSize.Width() rIStm >> aPrefSz.Height(); // PrefSize.Height() - // Header-Kennung und Versionsnummer pruefen + // check header-magic and version if( rIStm.GetError() || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 ) || ( nVersion != 200 ) ) @@ -427,9 +422,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR ); rIStm.SetNumberFormatInt( nOldFormat ); rIStm.Seek( nPos ); + return; } - else - { + + LineInfo aLineInfo( LINE_NONE, 0 ); + Stack aLIStack; + VirtualDevice aFontVDev; + rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); + BOOL bFatLine = FALSE; + + // TODO: fix reindentation below if you can accept being blamed by the SCM MapMode aMapMode; Polygon aActionPoly; Rectangle aRect; @@ -1157,7 +1159,6 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) // cleanup push-pop stack if neccessary for( void* pLineInfo = aLIStack.Pop(); pLineInfo; pLineInfo = aLIStack.Pop() ) delete (LineInfo*) pLineInfo; - } rIStm.SetNumberFormatInt( nOldFormat ); } diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index a77d8c2ac294..e421cb59aa4c 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -5241,15 +5241,15 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, if ( xBI.is() ) { - static const com::sun::star::lang::Locale aDefLocale(Application::GetSettings().GetUILocale()); + const com::sun::star::lang::Locale& rDefLocale(Application::GetSettings().GetUILocale()); xub_StrLen nSoftBreak = GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos ); DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" ); //aHyphOptions.hyphenIndex = nSoftBreak; - i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, aDefLocale, nPos, aHyphOptions, aUserOptions ); + i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions ); nBreakPos = (xub_StrLen)aLBR.breakIndex; if ( nBreakPos <= nPos ) nBreakPos = nSoftBreak; - if ( nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION ) + if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) { // Egal ob Trenner oder nicht: Das Wort nach dem Trenner durch // die Silbentrennung jagen... @@ -5261,7 +5261,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { sal_Unicode cAlternateReplChar = 0; sal_Unicode cAlternateExtraChar = 0; - i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, aDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); + i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); // sal_uInt16 nWordStart = nBreakPos; // sal_uInt16 nBreakPos_OLD = nBreakPos; sal_uInt16 nWordStart = nPos; @@ -5277,7 +5277,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, sal_uInt16 nMinTrail = static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben uno::Reference< linguistic2::XHyphenatedWord > xHyphWord; if (xHyph.is()) - xHyphWord = xHyph->hyphenate( aWord, aDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() ); + xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() ); if (xHyphWord.is()) { sal_Bool bAlternate = xHyphWord->isAlternativeSpelling(); @@ -5344,7 +5344,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, } // if (xHyphWord.is()) } // if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) ) } // if ( xHyph.is() ) - } // if ( nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION ) + } // if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) } nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos ); } @@ -6408,7 +6408,10 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr, sal_Int32* pAry = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen); if( nCutStart > nMinIndex ) memcpy( pAry, pDXArray, sizeof(sal_Int32)*(nCutStart-nMinIndex) ); - memcpy( pAry+nCutStart-nMinIndex, pDXArray + nOrgLen - (nCutStop-nMinIndex), nLen - (nCutStop-nMinIndex) ); + // note: nCutStart will never be smaller than nMinIndex + memcpy( pAry+nCutStart-nMinIndex, + pDXArray + nOrgLen - (nCutStop-nMinIndex), + sizeof(sal_Int32)*(nLen - (nCutStart-nMinIndex)) ); pDXArray = pAry; } } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 69f4674cae9c..0754f5c5b3dc 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6845,11 +6845,12 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric(); // collect the glyphs into a single array + const int nTmpMaxGlyphs = rLayout.GetOrientation() ? 1 : nMaxGlyphs; // #i97991# temporary workaround for #i87686# std::vector< PDFGlyph > aGlyphs; - aGlyphs.reserve( nMaxGlyphs ); + aGlyphs.reserve( nTmpMaxGlyphs ); // first get all the glyphs and register them; coordinates still in Pixel Point aGNGlyphPos; - while( (nGlyphs = rLayout.GetNextGlyphs( nMaxGlyphs, pGlyphs, aGNGlyphPos, nIndex, nAdvanceWidths, pCharPosAry )) != 0 ) + while( (nGlyphs = rLayout.GetNextGlyphs( nTmpMaxGlyphs, pGlyphs, aGNGlyphPos, nIndex, nAdvanceWidths, pCharPosAry )) != 0 ) { for( int i = 0; i < nGlyphs; i++ ) { @@ -8299,18 +8300,18 @@ void PDFWriterImpl::drawArc( const Rectangle& rRect, const Point& rStart, const return; // calculate start and stop angles - double fStartAngle = calcAngle( rRect, rStart ); + const double fStartAngle = calcAngle( rRect, rStart ); double fStopAngle = calcAngle( rRect, rStop ); while( fStopAngle < fStartAngle ) fStopAngle += 2.0*M_PI; - int nFragments = (int)((fStopAngle-fStartAngle)/(M_PI/2.0))+1; - double fFragmentDelta = (fStopAngle-fStartAngle)/(double)nFragments; - double kappa = fabs( 4.0 * (1.0-cos(fFragmentDelta/2.0))/sin(fFragmentDelta/2.0) / 3.0); - double halfWidth = (double)rRect.GetWidth()/2.0; - double halfHeight = (double)rRect.GetHeight()/2.0; + const int nFragments = (int)((fStopAngle-fStartAngle)/(M_PI/2.0))+1; + const double fFragmentDelta = (fStopAngle-fStartAngle)/(double)nFragments; + const double kappa = fabs( 4.0 * (1.0-cos(fFragmentDelta/2.0))/sin(fFragmentDelta/2.0) / 3.0); + const double halfWidth = (double)rRect.GetWidth()/2.0; + const double halfHeight = (double)rRect.GetHeight()/2.0; - Point aCenter( (rRect.Left()+rRect.Right()+1)/2, - (rRect.Top()+rRect.Bottom()+1)/2 ); + const Point aCenter( (rRect.Left()+rRect.Right()+1)/2, + (rRect.Top()+rRect.Bottom()+1)/2 ); OStringBuffer aLine( 30*nFragments ); Point aPoint( (int)(halfWidth * cos(fStartAngle) ), @@ -8318,27 +8319,30 @@ void PDFWriterImpl::drawArc( const Rectangle& rRect, const Point& rStart, const aPoint += aCenter; m_aPages.back().appendPoint( aPoint, aLine ); aLine.append( " m " ); - for( int i = 0; i < nFragments; i++ ) - { - double fStartFragment = fStartAngle + (double)i*fFragmentDelta; - double fStopFragment = fStartFragment + fFragmentDelta; - aPoint = Point( (int)(halfWidth * (cos(fStartFragment) - kappa*sin(fStartFragment) ) ), - -(int)(halfHeight * (sin(fStartFragment) + kappa*cos(fStartFragment) ) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( ' ' ); + if( !basegfx::fTools::equal(fStartAngle, fStopAngle) ) + { + for( int i = 0; i < nFragments; i++ ) + { + const double fStartFragment = fStartAngle + (double)i*fFragmentDelta; + const double fStopFragment = fStartFragment + fFragmentDelta; + aPoint = Point( (int)(halfWidth * (cos(fStartFragment) - kappa*sin(fStartFragment) ) ), + -(int)(halfHeight * (sin(fStartFragment) + kappa*cos(fStartFragment) ) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( ' ' ); - aPoint = Point( (int)(halfWidth * (cos(fStopFragment) + kappa*sin(fStopFragment) ) ), - -(int)(halfHeight * (sin(fStopFragment) - kappa*cos(fStopFragment) ) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( ' ' ); + aPoint = Point( (int)(halfWidth * (cos(fStopFragment) + kappa*sin(fStopFragment) ) ), + -(int)(halfHeight * (sin(fStopFragment) - kappa*cos(fStopFragment) ) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( ' ' ); - aPoint = Point( (int)(halfWidth * cos(fStopFragment) ), - -(int)(halfHeight * sin(fStopFragment) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( " c\n" ); + aPoint = Point( (int)(halfWidth * cos(fStopFragment) ), + -(int)(halfHeight * sin(fStopFragment) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( " c\n" ); + } } if( bWithChord || bWithPie ) { diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 11bed4b7ae67..0a5fbb189885 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -674,11 +674,11 @@ Printer::~Printer() } // ----------------------------------------------------------------------- -void Printer::SetNextJobIsQuick() +void Printer::SetNextJobIsQuick( bool bQuick ) { - mpPrinterData->mbNextJobIsQuick = true; + mpPrinterData->mbNextJobIsQuick = bQuick; if( mpQPrinter ) - mpQPrinter->SetNextJobIsQuick(); + mpQPrinter->SetNextJobIsQuick( bQuick ); } // ----------------------------------------------------------------------- diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 6bc5bb5b44c9..f6d93963540b 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -831,6 +831,10 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn // TODO: query GASP table for load flags mnLoadFlags = FT_LOAD_DEFAULT; +#if 1 // #i97326# cairo sometimes uses FT_Set_Transform() on our FT_FACE + // we are not using FT_Set_Transform() yet, so just ignore it for now + mnLoadFlags |= FT_LOAD_IGNORE_TRANSFORM; +#endif mbArtItalic = (rFSD.meItalic != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE); mbArtBold = (rFSD.meWeight > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM); @@ -1243,6 +1247,25 @@ int FreetypeServerFont::GetGlyphIndex( sal_UCS4 aChar ) const // ----------------------------------------------------------------------- +static int lcl_GetCharWidth( FT_FaceRec_* pFaceFT, double fStretch, int nGlyphFlags ) +{ + int nCharWidth = pFaceFT->glyph->metrics.horiAdvance; + + if( nGlyphFlags & GF_ROTMASK ) // for bVertical rotated glyphs + { + const FT_Size_Metrics& rMetrics = pFaceFT->size->metrics; +#if (FTVERSION < 2000) + nCharWidth = (int)((rMetrics.height - rMetrics.descender) * fStretch); +#else + nCharWidth = (int)((rMetrics.height + rMetrics.descender) * fStretch); +#endif + } + + return (nCharWidth + 32) >> 6; +} + +// ----------------------------------------------------------------------- + void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const { if( maSizeFT ) @@ -1282,20 +1305,12 @@ void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const return; } + const bool bOriginallyZeroWidth = (maFaceFT->glyph->metrics.horiAdvance == 0); if( mbArtBold && pFTEmbolden ) (*pFTEmbolden)( maFaceFT->glyph ); - int nCharWidth = maFaceFT->glyph->metrics.horiAdvance; - - if( nGlyphFlags & GF_ROTMASK ) { // for bVertical rotated glyphs - const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics; -#if (FTVERSION < 2000) - nCharWidth = (int)((rMetrics.height - rMetrics.descender) * mfStretch); -#else - nCharWidth = (int)((rMetrics.height + rMetrics.descender) * mfStretch); -#endif - } - rGD.SetCharWidth( (nCharWidth + 32) >> 6 ); + const int nCharWidth = bOriginallyZeroWidth ? 0 : lcl_GetCharWidth( maFaceFT, mfStretch, nGlyphFlags ); + rGD.SetCharWidth( nCharWidth ); FT_Glyph pGlyphFT; rc = FT_Get_Glyph( maFaceFT->glyph, &pGlyphFT ); @@ -2365,11 +2380,16 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) const USHORT nOffset= GetUShort( pFeatureHeader+4 ); pFeatureHeader += 6; - // feature (required && (requested || available))? - if( (aFeatureIndexList[0] != nFeatureIndex) - && (!std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag)) - || (!std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex) ) ) - continue; + // short circuit some feature lookups + if( aFeatureIndexList[0] != nFeatureIndex ) // required feature? + { + const int nRequested = std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex); + if( !nRequested ) // ignore features that are not requested + continue; + const int nAvailable = std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag); + if( !nAvailable ) // some fonts don't provide features they request! + continue; + } const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset; const USHORT nCntLookups = GetUShort( pFeatureTable+0 ); diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 5348d04c1a5d..16a0e5a05ad6 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -44,9 +44,6 @@ using namespace ::com::sun::star; - - - // ======================================================================= static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex ) @@ -274,65 +271,6 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, // ----------------------------------------------------------------------- -static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode, - USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE ) -{ - DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd), - "Window::ImplFindAccelWindow() - rIndex not in Form" ); - - xub_Unicode cCompareChar; - USHORT nStart = rIndex; - USHORT i = rIndex; - int bSearch = TRUE; - Window* pWindow; - - // MT: Where can we keep the CharClass?! - static uno::Reference< i18n::XCharacterClassification > xCharClass; - if ( !xCharClass.is() ) - xCharClass = vcl::unohelper::CreateCharacterClassification(); - - const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); - cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; - - if ( i < nFormEnd ) - pWindow = ImplGetNextWindow( pParent, i, i, TRUE ); - else - pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE ); - while ( bSearch ) - { - const XubString aStr = pWindow->GetText(); - USHORT nPos = aStr.Search( '~' ); - while ( nPos != STRING_NOTFOUND ) - { - cCompareChar = aStr.GetChar( nPos+1 ); - cCompareChar = xCharClass->toUpper( String(cCompareChar), 0, 1, rLocale )[0]; - if ( cCompareChar == cCharCode ) - { - // Bei Static-Controls auf das naechste Controlm weiterschalten - if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || - (pWindow->GetType() == WINDOW_FIXEDLINE) || - (pWindow->GetType() == WINDOW_GROUPBOX) ) - pWindow = pParent->ImplGetDlgWindow( i, DLGWINDOW_NEXT ); - rIndex = i; - return pWindow; - } - nPos = aStr.Search( '~', nPos+1 ); - } - - if ( i == nStart ) - break; - - if ( i < nFormEnd ) - pWindow = ImplGetNextWindow( pParent, i, i, bCheckEnable ); - else - pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); - } - - return NULL; -} - -// ----------------------------------------------------------------------- - static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex, USHORT& rFormStart, USHORT& rFormEnd ) { @@ -347,6 +285,10 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // Focus-Fenster in der Child-Liste suchen pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE ); + + if( pWindow == NULL ) + pWindow = pSWindow; + while ( pSWindow ) { if ( pSWindow->ImplGetWindow()->IsDialogControlStart() ) @@ -404,6 +346,85 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // ----------------------------------------------------------------------- +static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode, + USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE ) +{ + DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd), + "Window::ImplFindAccelWindow() - rIndex not in Form" ); + + xub_Unicode cCompareChar; + USHORT nStart = rIndex; + USHORT i = rIndex; + int bSearch = TRUE; + Window* pWindow; + + // MT: Where can we keep the CharClass?! + static uno::Reference< i18n::XCharacterClassification > xCharClass; + if ( !xCharClass.is() ) + xCharClass = vcl::unohelper::CreateCharacterClassification(); + + const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); + cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; + + if ( i < nFormEnd ) + pWindow = ImplGetNextWindow( pParent, i, i, TRUE ); + else + pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE ); + while ( bSearch ) + { + const XubString aStr = pWindow->GetText(); + USHORT nPos = aStr.Search( '~' ); + while ( nPos != STRING_NOTFOUND ) + { + cCompareChar = aStr.GetChar( nPos+1 ); + cCompareChar = xCharClass->toUpper( String(cCompareChar), 0, 1, rLocale )[0]; + if ( cCompareChar == cCharCode ) + { + // Bei Static-Controls auf das naechste Controlm weiterschalten + if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || + (pWindow->GetType() == WINDOW_FIXEDLINE) || + (pWindow->GetType() == WINDOW_GROUPBOX) ) + pWindow = pParent->ImplGetDlgWindow( i, DLGWINDOW_NEXT ); + rIndex = i; + return pWindow; + } + nPos = aStr.Search( '~', nPos+1 ); + } + + // #i93011# it would have made sense to have this really recursive + // right from the start. However this would cause unpredictable side effects now + // so instead we have a style bit for some child windows, that want their + // children checked for accelerators + if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 ) + { + USHORT nChildIndex; + USHORT nChildFormStart; + USHORT nChildFormEnd; + + // get form start and end + ::ImplFindDlgCtrlWindow( pWindow, NULL, + nChildIndex, nChildFormStart, nChildFormEnd ); + Window* pAccelWin = ImplFindAccelWindow( pWindow, nChildIndex, cCharCode, + nChildFormStart, nChildFormEnd, + bCheckEnable ); + if( pAccelWin ) + return pAccelWin; + } + + if ( i == nStart ) + break; + + if ( i < nFormEnd ) + pWindow = ImplGetNextWindow( pParent, i, i, bCheckEnable ); + else + pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); + } + + return NULL; +} + +// ----------------------------------------------------------------------- + void Window::ImplControlFocus( USHORT nFlags ) { if ( nFlags & GETFOCUS_MNEMONIC ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index d9891430f29d..caa43c3bef1e 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -4763,7 +4763,9 @@ Window::~Window() // ----------------------------------------------------------------------- void Window::doLazyDelete() { - if( dynamic_cast<SystemWindow*>(this) ) + SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(this); + DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(this); + if( pSysWin || ( pDockWin && pDockWin->IsFloatingMode() ) ) SetParent( ImplGetDefaultWindow() ); vcl::LazyDeletor<Window>::Delete( this ); } |