diff options
Diffstat (limited to 'vcl')
35 files changed, 381 insertions, 145 deletions
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 498c9679e97c..0174c1a68832 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -108,6 +108,7 @@ -(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; -(MacOSBOOL)sendSingleCharacter:(NSEvent*)pEvent; -(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent; +-(void)clearLastEvent; /* text action methods */ diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 247de1b95dec..1948018806e1 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -191,7 +191,7 @@ public: virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); // CopyArea --> No RasterOp, but ClipRegion virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 5b1e24befc9b..8a4744d1efcd 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -988,6 +988,7 @@ bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPol // ----------------------------------------------------------------------- bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, + double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin ) { @@ -1032,6 +1033,7 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, CGContextAddPath( mrContext, xPath ); // draw path with antialiased line CGContextSetShouldAntialias( mrContext, true ); + CGContextSetAlpha( mrContext, 1.0 - fTransparency ); CGContextSetLineJoin( mrContext, aCGLineJoin ); CGContextSetLineWidth( mrContext, rLineWidths.getX() ); CGContextDrawPath( mrContext, kCGPathStroke ); diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 0dfa0fa356aa..25dadf0e592b 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -1510,6 +1510,11 @@ private: mbKeyHandled = true; } +-(void)clearLastEvent +{ + mpLastEvent = nil; +} + - (NSRect)firstRectForCharacterRange:(NSRange)theRange { SalExtTextInputPosEvent aPosEvent; diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index f39d7c675bc4..ed3086d8506f 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -370,6 +370,10 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.nY - pParentAquaSalFrame->maGeometry.nY + offset; pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false); + // #i111992# if this menu was opened due to a key event, prevent dispatching that yet again + if( [pParentNSView respondsToSelector: @selector(clearLastEvent)] ) + [pParentNSView performSelector:@selector(clearLastEvent)]; + // open popup menu NSPopUpButtonCell * pPopUpButtonCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]; [pPopUpButtonCell setMenu: pCopyMenu]; diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx index 1d4e08991bda..2fa134af5078 100644..100755 --- a/vcl/inc/vcl/abstdlg.hxx +++ b/vcl/inc/vcl/abstdlg.hxx @@ -66,6 +66,16 @@ public: virtual void Sync() = 0; }; +class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog +{ +public: + virtual String GetPasswordToOpen() const = 0; + virtual String GetPasswordToModify() const = 0; + virtual bool IsRecommendToOpenReadonly() const = 0; +}; + +//------------------------------------------------------------- + class VCL_DLLPUBLIC VclAbstractDialogFactory { public: @@ -74,6 +84,9 @@ public: // nDialogId was previously a ResId without ResMgr; the ResourceId is now // an implementation detail of the factory virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId ) = 0; + + // creates instance of PasswordToOpenModifyDialog from cui + virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog( Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0; }; #endif diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx index c0cc3b5b51d6..908f3e30319c 100644 --- a/vcl/inc/vcl/menu.hxx +++ b/vcl/inc/vcl/menu.hxx @@ -41,6 +41,7 @@ struct MenuItemData; class Point; class Size; class Rectangle; +class Menu; class MenuItemList; class HelpEvent; class Image; @@ -102,6 +103,17 @@ typedef USHORT MenuItemBits; // forces images & toggle visibility for toolbar config popup #define MENU_FLAG_SHOWCHECKIMAGES 0x0008 +struct ImplMenuDelData +{ + ImplMenuDelData* mpNext; + const Menu* mpMenu; + + ImplMenuDelData( const Menu* pMenu ); + ~ImplMenuDelData(); + + bool isDeleted() const { return mpMenu == 0; } +}; + // -------- // - Menu - // -------- @@ -120,9 +132,9 @@ class VCL_DLLPUBLIC Menu : public Resource friend class MenuFloatingWindow; friend class PopupMenu; friend class SystemWindow; - + friend struct ImplMenuDelData; private: - void* pMenuData_NotUsedYet; + ImplMenuDelData* mpFirstDel; MenuItemList* pItemList; // Liste mit den MenuItems MenuLogo* pLogo; Menu* pStartedFrom; @@ -186,6 +198,8 @@ protected: // return value is Max( rCheckHeight, rRadioHeight ) SAL_DLLPRIVATE long ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth ) const; + SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel ); + SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel ); public: SAL_DLLPRIVATE void ImplKillLayoutData() const; SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const; diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 510e797678b0..08c489f7d466 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -125,7 +125,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) = 0; virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0; virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0; - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0; + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0; virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0; virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0; virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) = 0; @@ -373,7 +373,7 @@ public: PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev ); bool DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* ); - bool DrawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* ); + bool DrawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* ); sal_Bool DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index b8dc4eba0199..cf05ff15d7e2 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -162,7 +162,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx index 5be40355f731..dff1557170fb 100644 --- a/vcl/os2/source/gdi/salgdi.cxx +++ b/vcl/os2/source/gdi/salgdi.cxx @@ -670,6 +670,7 @@ bool Os2SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double / bool Os2SalGraphics::drawPolyLine( const basegfx::B2DPolygon& /*rPolygon*/, + double /*fTransparency*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eLineJoin*/) { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 08759f37d7a6..d66389eee62d 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1187,7 +1187,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags aSize.Width() -= ( 5 + nSymbolSize ); ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, - 1, nDrawFlags, nTextStyle ); + 1, nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 ); } else ImplCalcSymbolRect( aInRect ); @@ -3688,11 +3688,14 @@ void CheckBox::ImplCheck() else eNewState = STATE_NOCHECK; meState = eNewState; - ImplInvalidateOrDrawCheckBoxState(); ImplDelData aDelData; ImplAddDel( &aDelData ); - Toggle(); + if( (GetStyle() & WB_EARLYTOGGLE) ) + Toggle(); + ImplInvalidateOrDrawCheckBoxState(); + if( ! (GetStyle() & WB_EARLYTOGGLE) ) + Toggle(); if ( aDelData.IsDelete() ) return; ImplRemoveDel( &aDelData ); diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index bb5e4e3ba36d..a011e4ee4a92 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -2311,7 +2311,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine); } - if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) + if( mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) { return; } @@ -2416,7 +2416,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand( if(bTryAA) { - bDone = mpGraphics->DrawPolyLine(aCandidate, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLINEJOIN_NONE, this); + bDone = mpGraphics->DrawPolyLine( aCandidate, 0.0, basegfx::B2DVector(1.0,1.0), basegfx::B2DLINEJOIN_NONE, this); } if(!bDone) @@ -2605,7 +2605,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine); } - if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) + if(mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) { return; } @@ -2653,7 +2653,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && LINE_SOLID == rLineInfo.GetStyle()) { - DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin()); + DrawPolyLine( rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin()); return; } @@ -2785,7 +2785,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) aB2DPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolygon); } - bSuccess = mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } if(bSuccess) @@ -2877,7 +2877,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) for(sal_uInt32 a(0); bSuccess && a < aB2DPolyPolygon.count(); a++) { - bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } } @@ -3000,7 +3000,7 @@ void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPo for(sal_uInt32 a(0);bSuccess && a < aB2DPolyPolygon.count(); a++) { - bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } } @@ -3047,7 +3047,7 @@ bool OutputDevice::ImpTryDrawPolyLineDirect( } // draw the polyline - return mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, eLineJoin, this); + return mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, eLineJoin, this); } void OutputDevice::DrawPolyLine( diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index bef37284adbd..47b150ddc4c5 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -184,18 +184,31 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw) - && ROP_OVERPAINT == GetRasterOp() - && IsFillColor()) + && ROP_OVERPAINT == GetRasterOp() ) { // b2dpolygon support not implemented yet on non-UNX platforms const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly); - // transform the polygon and ensure closed - aB2DPolyPolygon.transform(aTransform); - aB2DPolyPolygon.setClosed(true); + // transform the polygon into device space and ensure it is closed + aB2DPolyPolygon.transform( aTransform ); + aB2DPolyPolygon.setClosed( true ); - if(mpGraphics->DrawPolyPolygon(aB2DPolyPolygon, fTransparency, this)) + bool bDrawnOk = true; + if( IsFillColor() ) + bDrawnOk = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this ); + if( bDrawnOk && IsLineColor() ) + { + const basegfx::B2DVector aHairlineWidth(1,1); + const int nPolyCount = aB2DPolyPolygon.count(); + for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) + { + const ::basegfx::B2DPolygon aOnePoly = aB2DPolyPolygon.getB2DPolygon( nPolyIdx ); + mpGraphics->DrawPolyLine( aOnePoly, fTransparency, aHairlineWidth, ::basegfx::B2DLINEJOIN_NONE, this ); + } + } + + if( bDrawnOk ) { #if 0 // MetaB2DPolyPolygonAction is not implemented yet: @@ -287,14 +300,17 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, // get the polygon in device coordinates basegfx::B2DPolyPolygon aB2DPolyPolygon( rPolyPoly.getB2DPolyPolygon() ); - aB2DPolyPolygon.setClosed( true ); const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); aB2DPolyPolygon.transform( aTransform ); - // draw the transparent polygon - bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, nTransparencePercent*0.01, this ); + const double fTransparency = 0.01 * nTransparencePercent; + if( mbFillColor ) + { + // draw the transparent polygon + // NOTE: filled polygons are assumed to be drawn as if they were always closed + bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this ); + } - // DrawTransparent() assumes that the border is NOT to be drawn transparently??? if( mbLineColor ) { // disable the fill color for now @@ -305,7 +321,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolygon& rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx ); - mpGraphics->DrawPolyLine( rPolygon, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this ); + bDrawn = mpGraphics->DrawPolyLine( rPolygon, fTransparency, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this ); } // prepare to restore the fill color mbInitFillColor = mbFillColor; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 77f7f74fc10e..6cb0a7d07697 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4081,15 +4081,15 @@ bool PDFWriterImpl::emitFonts() } else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA? { - unsigned char* pBuffer = new unsigned char[ (int)nLength1 ]; + boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] ); sal_uInt64 nBytesRead = 0; - CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer, nLength1, &nBytesRead ) ) ); + CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) ); DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" ); CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) ); // get the PFB-segment lengths ThreeInts aSegmentLengths = {0,0,0}; - getPfbSegmentLengths( pBuffer, (int)nBytesRead, aSegmentLengths ); + getPfbSegmentLengths( pBuffer.get(), (int)nBytesRead, aSegmentLengths ); // the lengths below are mandatory for PDF-exported Type1 fonts // because the PFB segment headers get stripped! WhyOhWhy. aLine.append( (sal_Int32)aSegmentLengths[0] ); @@ -4106,11 +4106,9 @@ bool PDFWriterImpl::emitFonts() // emit PFB-sections without section headers beginCompression(); checkAndEnableStreamEncryption( nFontStream ); - CHECK_RETURN( writeBuffer( pBuffer+ 6, aSegmentLengths[0] ) ); - CHECK_RETURN( writeBuffer( pBuffer+12 + aSegmentLengths[0], aSegmentLengths[1] ) ); - CHECK_RETURN( writeBuffer( pBuffer+18 + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); - - delete[] pBuffer; + CHECK_RETURN( writeBuffer( &pBuffer[6], aSegmentLengths[0] ) ); + CHECK_RETURN( writeBuffer( &pBuffer[12] + aSegmentLengths[0], aSegmentLengths[1] ) ); + CHECK_RETURN( writeBuffer( &pBuffer[18] + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); } else { diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 84e45979d679..7a6808a0e392 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -405,6 +405,7 @@ void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, cons } bool SalGraphics::drawPolyLine( const basegfx::B2DPolygon& /*rPolyPolygon*/, + double /*fTransparency*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eLineJoin*/) { @@ -536,7 +537,7 @@ sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt3 return bRet; } -bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, +bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double fTransparency, const ::basegfx::B2DVector& i_rLineWidth, basegfx::B2DLineJoin i_eLineJoin, const OutputDevice* i_pOutDev ) { @@ -544,10 +545,10 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) { basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) ); - bRet = drawPolyLine( aMirror, i_rLineWidth, i_eLineJoin ); + bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin ); } else - bRet = drawPolyLine( i_rPolygon, i_rLineWidth, i_eLineJoin ); + bRet = drawPolyLine( i_rPolygon, fTransparency, i_rLineWidth, i_eLineJoin ); return bRet; } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index cebe1d1f596c..1723d26ce399 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -938,6 +938,14 @@ Menu::~Menu() if ( nEventId ) Application::RemoveUserEvent( nEventId ); + // Notify deletion of this menu + ImplMenuDelData* pDelData = mpFirstDel; + while ( pDelData ) + { + pDelData->mpMenu = NULL; + pDelData = pDelData->mpNext; + } + bKilled = TRUE; delete pItemList; @@ -970,7 +978,7 @@ void Menu::ImplInit() bInCallback = FALSE; bKilled = FALSE; mpLayoutData = NULL; - + mpFirstDel = NULL; // Dtor notification list // Native-support: returns NULL if not supported mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar ); } @@ -1034,19 +1042,29 @@ void Menu::CreateAutoMnemonics() void Menu::Activate() { bInCallback = TRUE; + + ImplMenuDelData aDelData( this ); + ImplCallEventListeners( VCLEVENT_MENU_ACTIVATE, ITEMPOS_INVALID ); - if ( !aActivateHdl.Call( this ) ) + + if( !aDelData.isDeleted() ) { - Menu* pStartMenu = ImplGetStartMenu(); - if ( pStartMenu && ( pStartMenu != this ) ) + if ( !aActivateHdl.Call( this ) ) { - pStartMenu->bInCallback = TRUE; - // MT 11/01: Call EventListener here? I don't know... - pStartMenu->aActivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + { + Menu* pStartMenu = ImplGetStartMenu(); + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->bInCallback = TRUE; + // MT 11/01: Call EventListener here? I don't know... + pStartMenu->aActivateHdl.Call( this ); + pStartMenu->bInCallback = FALSE; + } + } } + bInCallback = FALSE; } - bInCallback = FALSE; } void Menu::Deactivate() @@ -1059,33 +1077,49 @@ void Menu::Deactivate() } bInCallback = TRUE; + + ImplMenuDelData aDelData( this ); + Menu* pStartMenu = ImplGetStartMenu(); ImplCallEventListeners( VCLEVENT_MENU_DEACTIVATE, ITEMPOS_INVALID ); - if ( !aDeactivateHdl.Call( this ) ) + + if( !aDelData.isDeleted() ) { - if ( pStartMenu && ( pStartMenu != this ) ) + if ( !aDeactivateHdl.Call( this ) ) { - pStartMenu->bInCallback = TRUE; - pStartMenu->aDeactivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + { + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->bInCallback = TRUE; + pStartMenu->aDeactivateHdl.Call( this ); + pStartMenu->bInCallback = FALSE; + } + } } } - bInCallback = FALSE; - if ( this == pStartMenu ) - GetpApp()->HideHelpStatusText(); + if( !aDelData.isDeleted() ) + { + bInCallback = FALSE; + + if ( this == pStartMenu ) + GetpApp()->HideHelpStatusText(); + } } void Menu::Highlight() { + ImplMenuDelData aDelData( this ); + Menu* pStartMenu = ImplGetStartMenu(); - if ( !aHighlightHdl.Call( this ) ) + if ( !aHighlightHdl.Call( this ) && !aDelData.isDeleted() ) { if ( pStartMenu && ( pStartMenu != this ) ) pStartMenu->aHighlightHdl.Call( this ); } - if ( GetCurItemId() ) + if ( !aDelData.isDeleted() && GetCurItemId() ) GetpApp()->ShowHelpStatusText( GetHelpText( GetCurItemId() ) ); } @@ -1112,14 +1146,19 @@ void Menu::ImplSelect() void Menu::Select() { + ImplMenuDelData aDelData( this ); + ImplCallEventListeners( VCLEVENT_MENU_SELECT, GetItemPos( GetCurItemId() ) ); - if ( !aSelectHdl.Call( this ) ) + if ( !aDelData.isDeleted() && !aSelectHdl.Call( this ) ) { - Menu* pStartMenu = ImplGetStartMenu(); - if ( pStartMenu && ( pStartMenu != this ) ) + if( !aDelData.isDeleted() ) { - pStartMenu->nSelectedId = nSelectedId; - pStartMenu->aSelectHdl.Call( this ); + Menu* pStartMenu = ImplGetStartMenu(); + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->nSelectedId = nSelectedId; + pStartMenu->aSelectHdl.Call( this ); + } } } } @@ -1141,6 +1180,8 @@ void Menu::RequestHelp( const HelpEvent& ) void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) { + ImplMenuDelData aDelData( this ); + VclMenuEvent aEvent( this, nEvent, nPos ); // This is needed by atk accessibility bridge @@ -1149,16 +1190,22 @@ void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) ImplGetSVData()->mpApp->ImplCallEventListeners( &aEvent ); } - if ( !maEventListeners.empty() ) + if ( !aDelData.isDeleted() && !maEventListeners.empty() ) maEventListeners.Call( &aEvent ); - Menu* pMenu = this; - while ( pMenu ) + if( !aDelData.isDeleted() ) { - if ( !maChildEventListeners.empty() ) - maChildEventListeners.Call( &aEvent ); + Menu* pMenu = this; + while ( pMenu ) + { + if ( !maChildEventListeners.empty() ) + maChildEventListeners.Call( &aEvent ); + + if( aDelData.isDeleted() ) + break; - pMenu = ( pMenu->pStartedFrom != pMenu ) ? pMenu->pStartedFrom : NULL; + pMenu = ( pMenu->pStartedFrom != pMenu ) ? pMenu->pStartedFrom : NULL; + } } } @@ -2261,6 +2308,42 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight; } +// ----------------------------------------------------------------------- + +void Menu::ImplAddDel( ImplMenuDelData& rDel ) +{ + DBG_ASSERT( !rDel.mpMenu, "Menu::ImplAddDel(): cannot add ImplMenuDelData twice !" ); + if( !rDel.mpMenu ) + { + rDel.mpMenu = this; + rDel.mpNext = mpFirstDel; + mpFirstDel = &rDel; + } +} + +// ----------------------------------------------------------------------- + +void Menu::ImplRemoveDel( ImplMenuDelData& rDel ) +{ + rDel.mpMenu = NULL; + if ( mpFirstDel == &rDel ) + { + mpFirstDel = rDel.mpNext; + } + else + { + ImplMenuDelData* pData = mpFirstDel; + while ( pData && (pData->mpNext != &rDel) ) + pData = pData->mpNext; + + DBG_ASSERT( pData, "Menu::ImplRemoveDel(): ImplMenuDelData not registered !" ); + if( pData ) + pData->mpNext = rDel.mpNext; + } +} + +// ----------------------------------------------------------------------- + Size Menu::ImplCalcSize( Window* pWin ) { // | Checked| Image| Text| Accel/Popup| @@ -2790,13 +2873,19 @@ Menu* Menu::ImplGetStartMenu() void Menu::ImplCallHighlight( USHORT nHighlightedItem ) { + ImplMenuDelData aDelData( this ); + nSelectedId = 0; MenuItemData* pData = pItemList->GetDataFromPos( nHighlightedItem ); if ( pData ) nSelectedId = pData->nId; ImplCallEventListeners( VCLEVENT_MENU_HIGHLIGHT, GetItemPos( GetCurItemId() ) ); - Highlight(); - nSelectedId = 0; + + if( !aDelData.isDeleted() ) + { + Highlight(); + nSelectedId = 0; + } } IMPL_LINK( Menu, ImplCallSelect, Menu*, EMPTYARG ) @@ -3292,10 +3381,14 @@ BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const { if( pMenu ) { + ImplMenuDelData aDelData( this ); + pMenu->pStartedFrom = (Menu*)this; pMenu->bInCallback = TRUE; pMenu->Activate(); - pMenu->bInCallback = FALSE; + + if( !aDelData.isDeleted() ) + pMenu->bInCallback = FALSE; } return TRUE; } @@ -3304,10 +3397,13 @@ BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const { if( pMenu ) { + ImplMenuDelData aDelData( this ); + pMenu->pStartedFrom = (Menu*)this; pMenu->bInCallback = TRUE; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + pMenu->bInCallback = FALSE; } return TRUE; } @@ -3318,13 +3414,18 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId ); if( pMenu ) { + ImplMenuDelData aDelData( pMenu ); + if( mnHighlightedItemPos != ITEMPOS_INVALID ) pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, mnHighlightedItemPos ); - pMenu->mnHighlightedItemPos = pMenu->GetItemPos( nHighlightEventId ); - pMenu->nSelectedId = nHighlightEventId; - pMenu->pStartedFrom = (Menu*)this; - pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); + if( !aDelData.isDeleted() ) + { + pMenu->mnHighlightedItemPos = pMenu->GetItemPos( nHighlightEventId ); + pMenu->nSelectedId = nHighlightEventId; + pMenu->pStartedFrom = (Menu*)this; + pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); + } return TRUE; } else @@ -5989,3 +6090,17 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) } return FALSE; } + +ImplMenuDelData::ImplMenuDelData( const Menu* pMenu ) +: mpNext( 0 ) +, mpMenu( 0 ) +{ + if( pMenu ) + const_cast< Menu* >( pMenu )->ImplAddDel( *this ); +} + +ImplMenuDelData::~ImplMenuDelData() +{ + if( mpMenu ) + const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this ); +} diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index ca92d9ed6c5b..ebeb5c94d68a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8650,7 +8650,10 @@ Reference< XClipboard > Window::GetClipboard() if( xFactory.is() ) { - mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY ); + + if( !mpWindowImpl->mpFrameData->mxClipboard.is() ) + mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY ); #if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized if( mpWindowImpl->mpFrameData->mxClipboard.is() ) @@ -8713,6 +8716,9 @@ Reference< XClipboard > Window::GetPrimarySelection() static Reference< XClipboard > s_xSelection; if ( !s_xSelection.is() ) + s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY ); + + if ( !s_xSelection.is() ) s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxSelection = s_xSelection; diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 11d567c85098..c6ff16f8395b 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3757,8 +3757,21 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint if (xText.is()) { sal_uInt32 nPosition = xText->getCaretPosition(); - xText->deleteText(nPosition + offset, nPosition + offset + nchars); - return TRUE; + // --> OD 2010-06-04 #i111768# - apply patch from kstribley: + // range checking +// xText->deleteText(nPosition + offset, nPosition + offset + nchars); + sal_Int32 nDeletePos = nPosition + offset; + sal_Int32 nDeleteEnd = nDeletePos + nchars; + if (nDeletePos < 0) + nDeletePos = 0; + if (nDeleteEnd < 0) + nDeleteEnd = 0; + if (nDeleteEnd > xText->getCharacterCount()) + nDeleteEnd = xText->getCharacterCount(); + + xText->deleteText(nDeletePos, nDeleteEnd); + // <-- + return TRUE; } return FALSE; diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index e65c9faf1432..68d8be7cb4eb 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -382,7 +382,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, dbgOut( m_aDevice ); } -bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) +bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) { // TODO: implement and advertise OutDevSupport_B2DDraw support return false; diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 132dafaa9adf..ca1af87f8862 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -121,7 +121,7 @@ public: virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 7f551051c1a7..6da09b38023c 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -323,7 +323,7 @@ void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly, m_pPrinterGfx->DrawPolyPolygon (nPoly, pPoints, (const Point**)pPtAry); } -bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) +bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) { // TODO: implement and advertise OutDevSupport_B2DDraw support return false; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 82ba613615cb..063dff34c3c2 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -142,7 +142,7 @@ public: virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 2eae73cdaa86..4b1ac12116a3 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -142,7 +142,7 @@ public: const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 6ccea2c4a00c..42d9c5592317 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -294,7 +294,7 @@ public: const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency ); #if 1 // TODO: remove these obselete methods diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx index cf7f7e082e69..c9515f016433 100644 --- a/vcl/unx/source/app/keysymnames.cxx +++ b/vcl/unx/source/app/keysymnames.cxx @@ -637,6 +637,7 @@ const char* SalDisplay::GetKeyboardName( BOOL bRefresh ) } } } + close(kbd); } } #else diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx index dbaa278a780b..959d6af5912d 100644 --- a/vcl/unx/source/app/sm.cxx +++ b/vcl/unx/source/app/sm.cxx @@ -159,6 +159,10 @@ class ICEConnectionObserver static int nWakeupFiles[2]; static oslMutex ICEMutex; static oslThread ICEThread; +#ifdef USE_SM_EXTENSION + static IceIOErrorHandler origIOErrorHandler; + static IceErrorHandler origErrorHandler; +#endif public: static void activate(); @@ -179,6 +183,19 @@ oslMutex ICEConnectionObserver::ICEMutex = NULL; oslThread ICEConnectionObserver::ICEThread = NULL; int ICEConnectionObserver::nWakeupFiles[2] = { 0, 0 }; +#ifdef USE_SM_EXTENSION +IceIOErrorHandler ICEConnectionObserver::origIOErrorHandler = NULL; +IceErrorHandler ICEConnectionObserver::origErrorHandler = NULL; + +static void IgnoreIceErrors(IceConn, Bool, int, unsigned long, int, int, IcePointer) +{ +} + +static void IgnoreIceIOErrors(IceConn) +{ +} +#endif + // HACK bool SessionManagerClient::bDocSaveDone = false; @@ -591,6 +608,12 @@ void ICEConnectionObserver::activate() ICEMutex = osl_createMutex(); bIsWatching = TRUE; #ifdef USE_SM_EXTENSION + /* + * Default handlers call exit, we don't care that strongly if something + * happens to fail + */ + origIOErrorHandler = IceSetIOErrorHandler( IgnoreIceIOErrors ); + origErrorHandler = IceSetErrorHandler( IgnoreIceErrors ); IceAddConnectionWatch( ICEWatchProc, NULL ); #endif } @@ -604,6 +627,8 @@ void ICEConnectionObserver::deactivate() bIsWatching = FALSE; #ifdef USE_SM_EXTENSION IceRemoveConnectionWatch( ICEWatchProc, NULL ); + IceSetErrorHandler( origErrorHandler ); + IceSetIOErrorHandler( origIOErrorHandler ); #endif nConnections = 0; if( ICEThread ) diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index fb2317e19573..1a116fcbe8d6 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -1407,56 +1407,59 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy pFrame->meWindowType = eType; pFrame->mnDecorationFlags = nDecorationFlags; - // set mwm hints - struct _mwmhints { - unsigned long flags, func, deco; - long input_mode; - unsigned long status; - } aHint; - - aHint.flags = 15; /* flags for functions, decoration, input mode and status */ - aHint.deco = 0; - aHint.func = 1L << 2; - aHint.status = 0; - aHint.input_mode = 0; - - // evaluate decoration flags - if( nDecorationFlags & decoration_All ) - aHint.deco = 1, aHint.func = 1; - else - { - if( nDecorationFlags & decoration_Title ) - aHint.deco |= 1L << 3; - if( nDecorationFlags & decoration_Border ) - aHint.deco |= 1L << 1; - if( nDecorationFlags & decoration_Resize ) - aHint.deco |= 1L << 2, aHint.func |= 1L << 1; - if( nDecorationFlags & decoration_MinimizeBtn ) - aHint.deco |= 1L << 5, aHint.func |= 1L << 3; - if( nDecorationFlags & decoration_MaximizeBtn ) - aHint.deco |= 1L << 6, aHint.func |= 1L << 4; - if( nDecorationFlags & decoration_CloseBtn ) - aHint.deco |= 1L << 4, aHint.func |= 1L << 5; - } - // evaluate window type - switch( eType ) + if( ! pFrame->mbFullScreen ) { - case windowType_ModalDialogue: - aHint.input_mode = 1; - break; - default: - break; - } + // set mwm hints + struct _mwmhints { + unsigned long flags, func, deco; + long input_mode; + unsigned long status; + } aHint; + + aHint.flags = 15; /* flags for functions, decoration, input mode and status */ + aHint.deco = 0; + aHint.func = 1L << 2; + aHint.status = 0; + aHint.input_mode = 0; + + // evaluate decoration flags + if( nDecorationFlags & decoration_All ) + aHint.deco = 1, aHint.func = 1; + else + { + if( nDecorationFlags & decoration_Title ) + aHint.deco |= 1L << 3; + if( nDecorationFlags & decoration_Border ) + aHint.deco |= 1L << 1; + if( nDecorationFlags & decoration_Resize ) + aHint.deco |= 1L << 2, aHint.func |= 1L << 1; + if( nDecorationFlags & decoration_MinimizeBtn ) + aHint.deco |= 1L << 5, aHint.func |= 1L << 3; + if( nDecorationFlags & decoration_MaximizeBtn ) + aHint.deco |= 1L << 6, aHint.func |= 1L << 4; + if( nDecorationFlags & decoration_CloseBtn ) + aHint.deco |= 1L << 4, aHint.func |= 1L << 5; + } + // evaluate window type + switch( eType ) + { + case windowType_ModalDialogue: + aHint.input_mode = 1; + break; + default: + break; + } - // set the hint - XChangeProperty( m_pDisplay, - pFrame->GetShellWindow(), - m_aWMAtoms[ MOTIF_WM_HINTS ], - m_aWMAtoms[ MOTIF_WM_HINTS ], - 32, - PropModeReplace, - (unsigned char*)&aHint, - 5 ); + // set the hint + XChangeProperty( m_pDisplay, + pFrame->GetShellWindow(), + m_aWMAtoms[ MOTIF_WM_HINTS ], + m_aWMAtoms[ MOTIF_WM_HINTS ], + 32, + PropModeReplace, + (unsigned char*)&aHint, + 5 ); + } // set transientFor hint /* #91030# dtwm will not map a dialogue if the transient diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 816c8fb0b4c4..3e24cd7c8e45 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -851,7 +851,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bRet ); + fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk ); #endif if( bDirOk ) diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index d599e09e71f2..d3eb103b9dd6 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -403,7 +403,7 @@ bool PspGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT return false; } -bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/) +bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTranspareny*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/) { // TODO: a PS printer can draw B2DPolyLines almost directly return false; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 15e391256344..ae21c3aa9f7b 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1089,7 +1089,7 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // draw a poly-polygon -bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency) +bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency ) { // nothing to do for empty polypolygons const int nOrigPolyCount = rOrigPolyPoly.count(); @@ -1203,7 +1203,7 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin) +bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin) { const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && (rLineWidth.getX() <= 1.2); @@ -1239,7 +1239,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : // draw tesselation result const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, 0.0 ); + const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); // restore the original brush GC nBrushColor_ = aKeepBrushColor; @@ -1271,7 +1271,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) ); - bDrawOk = drawPolyPolygon( aOnePoly, 0.0 ); + bDrawOk = drawPolyPolygon( aOnePoly, fTransparency ); if( !bDrawOk ) break; } diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 3491622f783c..90c6a196143e 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -694,6 +694,18 @@ BOOL PspSalInfoPrinter::SetData( pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; + + // some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5) + // try to find the correct paper anyway using the size + if( pKey && ! pValue && pJobSetup->mePaperFormat != PAPER_USER ) + { + PaperInfo aInfo( pJobSetup->mePaperFormat ); + aPaper = aData.m_pParser->matchPaper( + TenMuToPt( aInfo.getWidth() ), + TenMuToPt( aInfo.getHeight() ) ); + pValue = pKey->getValueCaseInsensitive( aPaper ); + } + if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) return FALSE; } diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 3e885d8af5b4..5e18849b8dfe 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -284,7 +284,8 @@ removeSpoolDir (const rtl::OUString& rSpoolDir) nChar = psp::appendStr ("rm -rf ", pSystem); nChar += psp::appendStr (aSysPathByte.getStr(), pSystem + nChar); - system (pSystem); + if (system (pSystem) == -1) + OSL_ENSURE( 0, "psprint: couldn't remove spool directory" ); } /* creates a spool directory with a "pidgin random" value based on diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index 4b97eeb98c0b..b1bfcbee96f4 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -194,7 +194,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx index b7ea81d313ae..14cb5d63437a 100644 --- a/vcl/win/source/app/salinfo.cxx +++ b/vcl/win/source/app/salinfo.cxx @@ -160,7 +160,8 @@ bool WinSalSystem::initMonitors() std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount; while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) ) { - if( (aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) == 0 ) // sort out non monitors + if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE) + && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors { aDev.DeviceName[31] = 0; aDev.DeviceString[127] = 0; diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index c621d81dce40..88efbb29d30a 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -189,14 +189,15 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly return true; } -bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin) +bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin ) { const sal_uInt32 nCount(rPolygon.count()); if(mbPen && nCount) { Gdiplus::Graphics aGraphics(mhDC); - Gdiplus::Color aTestColor(255, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); + const sal_uInt8 aTrans = (sal_uInt8)basegfx::fround( 255 * (1.0 - fTransparency) ); + Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); Gdiplus::GraphicsPath aPath; bool bNoLineJoin(false); |