diff options
44 files changed, 669 insertions, 206 deletions
diff --git a/dtrans/source/X11/X11_selection.cxx b/dtrans/source/X11/X11_selection.cxx index 582dd10d041e..2a424984850a 100644 --- a/dtrans/source/X11/X11_selection.cxx +++ b/dtrans/source/X11/X11_selection.cxx @@ -2073,10 +2073,14 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify ) #endif ::std::hash_map< Atom, Selection* >::iterator it = m_aSelections.find( rNotify.selection ); - if( ( rNotify.requestor == m_aWindow || rNotify.requestor == m_aCurrentDropWindow ) && - it != m_aSelections.end() && - ( it->second->m_eState == Selection::WaitingForResponse ) || - ( it->second->m_eState == Selection::WaitingForData ) ) + if ( + (rNotify.requestor == m_aWindow || rNotify.requestor == m_aCurrentDropWindow) && + it != m_aSelections.end() && + ( + (it->second->m_eState == Selection::WaitingForResponse) || + (it->second->m_eState == Selection::WaitingForData) + ) + ) { bHandled = true; if( it->second->m_aRequestedType == m_nMULTIPLEAtom ) diff --git a/dtrans/source/aqua/aqua_clipboard.cxx b/dtrans/source/aqua/aqua_clipboard.cxx index 166afa686478..d0b821099ea0 100644 --- a/dtrans/source/aqua/aqua_clipboard.cxx +++ b/dtrans/source/aqua/aqua_clipboard.cxx @@ -191,28 +191,30 @@ Reference<XTransferable> SAL_CALL AquaClipboard::getContents() throw(RuntimeExce void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransferable, - const Reference<XClipboardOwner>& xClipboardOwner) - throw( RuntimeException ) + const Reference<XClipboardOwner>& xClipboardOwner) + throw( RuntimeException ) { - ClearableMutexGuard aGuard(m_aMutex); + ClearableMutexGuard aGuard(m_aMutex); - Reference<XClipboardOwner> oldOwner(mXClipboardOwner); - mXClipboardOwner = xClipboardOwner; + Reference<XClipboardOwner> oldOwner(mXClipboardOwner); + mXClipboardOwner = xClipboardOwner; - Reference<XTransferable> oldContent(mXClipboardContent); - mXClipboardContent = xTransferable; + Reference<XTransferable> oldContent(mXClipboardContent); + mXClipboardContent = xTransferable; - NSArray* types = mpDataFlavorMapper->flavorSequenceToTypesArray(mXClipboardContent->getTransferDataFlavors()); - mPasteboardChangeCount = [mPasteboard declareTypes: types owner: mEventListener]; + NSArray* types = mXClipboardContent.is() ? + mpDataFlavorMapper->flavorSequenceToTypesArray(mXClipboardContent->getTransferDataFlavors()) : + [NSArray array]; + mPasteboardChangeCount = [mPasteboard declareTypes: types owner: mEventListener]; - // if we are already the owner of the clipboard - // then fire lost ownership event - if (oldOwner.is()) + // if we are already the owner of the clipboard + // then fire lost ownership event + if (oldOwner.is()) { - fireLostClipboardOwnershipEvent(oldOwner, oldContent); + fireLostClipboardOwnershipEvent(oldOwner, oldContent); } - fireClipboardChangedEvent(); + fireClipboardChangedEvent(); } diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx index d479d3c638fc..b7bdd2a606db 100644 --- a/svtools/inc/svtools/textview.hxx +++ b/svtools/inc/svtools/textview.hxx @@ -136,6 +136,8 @@ public: String GetSelected( LineEnd aSeparator ); void DeleteSelected(); + void InsertNewText( const rtl::OUString& rNew, BOOL bSelect = FALSE ); + // deprecated: use InsertNewText instead void InsertText( const String& rNew, BOOL bSelect = FALSE ); BOOL KeyInput( const KeyEvent& rKeyEvent ); diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index bcbe2b1b6386..66e01d351366 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -1163,13 +1163,10 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC uno::Any aData = xDataObj->getTransferData( aFlavor ); ::rtl::OUString aText; aData >>= aText; - - bool bWasTruncated = ImplTruncateNewText( aText ); - - String aStr( aText ); - aStr.ConvertLineEnd( LINEEND_LF ); - - InsertText( aText, FALSE ); + bool bWasTruncated = false; + if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 ) + bWasTruncated = ImplTruncateNewText( aText ); + InsertNewText( aText, FALSE ); mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); if( bWasTruncated ) @@ -1288,6 +1285,55 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) void TextView::InsertText( const XubString& rStr, BOOL bSelect ) { + InsertNewText( rStr, bSelect ); +} + +void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect ) +{ +// HideSelection(); + mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT ); + + /* #i87633# + break inserted text into chunks that fit into the underlying String + based API (which has a maximum length of 65534 elements + + note: this will of course still cause problems for lines longer than those + 65534 elements, but those cases will hopefully be few. + In the long run someone should switch the TextEngine to OUString instead of String + */ + sal_Int32 nLen = rStr.getLength(); + sal_Int32 nPos = 0; + while( nLen ) + { + sal_Int32 nChunkLen = nLen > 65534 ? 65534 : nLen; + String aChunk( rStr.copy( nPos, nChunkLen ) ); + + TextSelection aNewSel( mpImpl->maSelection ); + + TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, aChunk ); + + if ( bSelect ) + { + aNewSel.Justify(); + aNewSel.GetEnd() = aPaM; + } + else + { + aNewSel = aPaM; + } + + ImpSetSelection( aNewSel ); + nLen -= nChunkLen; + nPos += nChunkLen; + } + mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT ); + + mpImpl->mpTextEngine->FormatAndUpdate( this ); +} + +/* +void TextView::InsertText( const XubString& rStr, BOOL bSelect ) +{ // HideSelection(); TextSelection aNewSel( mpImpl->maSelection ); @@ -1310,6 +1356,7 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect ) mpImpl->mpTextEngine->FormatAndUpdate( this ); } +*/ // OLD TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode ) @@ -1922,20 +1969,22 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const } ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); - if( nMaxLen == 0 ) // 0 means unlimited - nMaxLen = 65534; // limit to string api - ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen(); - - sal_uInt32 nNewLen = rNewText.getLength(); - if ( nCurLen + nNewLen > nMaxLen ) + // 0 means unlimited, there is just the String API limit handled above + if( nMaxLen != 0 ) { - // see how much text will be replaced - ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); - if ( nCurLen + nNewLen - nSelLen > nMaxLen ) + ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen(); + + sal_uInt32 nNewLen = rNewText.getLength(); + if ( nCurLen + nNewLen > nMaxLen ) { - sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen)); - rNewText = rNewText.copy( 0, nTruncatedLen ); - bTruncated = true; + // see how much text will be replaced + ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); + if ( nCurLen + nNewLen - nSelLen > nMaxLen ) + { + sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen)); + rNewText = rNewText.copy( 0, nTruncatedLen ); + bTruncated = true; + } } } return bTruncated; diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index d32ef0789f93..ab603141cc60 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -102,6 +102,7 @@ protected: CGLayerRef mxLayer; // Quartz graphics layer CGContextRef mrContext; // Quartz drawing context class XorEmulation* mpXorEmulation; + int mnXorMode; // 0: off 1: on 2: invert only int mnWidth; int mnHeight; int mnBitmapDepth; // zero unless bitmap @@ -264,7 +265,7 @@ public: // filled accordingly virtual void SetFillColor( SalColor nSalColor ); // enable/disable XOR drawing - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool bInvertOnly ); // set line color for raster operations virtual void SetROPLineColor( SalROPColor nROPColor ); // set fill color for raster operations diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index dece56641533..42f29d677b52 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -254,8 +254,17 @@ bool AquaSalBitmap::AllocateUserData() } } - if( mnBytesPerRow ) - maUserBuffer.reset( new sal_uInt8[mnBytesPerRow * mnHeight] ); + try + { + if( mnBytesPerRow ) + maUserBuffer.reset( new sal_uInt8[mnBytesPerRow * mnHeight] ); + } + catch( const std::bad_alloc& ) + { + DBG_ERROR( "vcl::AquaSalBitmap::AllocateUserData: bad alloc" ); + maUserBuffer.reset( NULL ); + mnBytesPerRow = 0; + } return maUserBuffer.get() != 0; } diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index dbed132f03ac..e90137c92f92 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -267,6 +267,7 @@ AquaSalGraphics::AquaSalGraphics() , mxLayer( NULL ) , mrContext( NULL ) , mpXorEmulation( NULL ) + , mnXorMode( 0 ) , mnWidth( 0 ) , mnHeight( 0 ) , mnBitmapDepth( 0 ) @@ -2212,11 +2213,25 @@ SystemGraphicsData AquaSalGraphics::GetGraphicsData() const // ----------------------------------------------------------------------- -void AquaSalGraphics::SetXORMode( BOOL bSet ) +void AquaSalGraphics::SetXORMode( bool bSet, bool bInvertOnly ) { // return early if XOR mode remains unchanged if( mbPrinter ) return; + + if( ! bSet && mnXorMode == 2 ) + { + CGContextSetBlendMode( mrContext, kCGBlendModeNormal ); + mnXorMode = 0; + return; + } + else if( bSet && bInvertOnly && mnXorMode == 0) + { + CGContextSetBlendMode( mrContext, kCGBlendModeDifference ); + mnXorMode = 2; + return; + } + if( (mpXorEmulation == NULL) && !bSet ) return; if( (mpXorEmulation != NULL) && (bSet == mpXorEmulation->IsEnabled()) ) @@ -2236,12 +2251,14 @@ void AquaSalGraphics::SetXORMode( BOOL bSet ) { mpXorEmulation->Enable(); mrContext = mpXorEmulation->GetMaskContext(); + mnXorMode = 1; } else { mpXorEmulation->UpdateTarget(); mpXorEmulation->Disable(); mrContext = mpXorEmulation->GetTargetContext(); + mnXorMode = 0; } } diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx index 938f25209287..066268791b11 100755 --- a/vcl/aqua/source/gdi/salgdiutils.cxx +++ b/vcl/aqua/source/gdi/salgdiutils.cxx @@ -143,6 +143,8 @@ void AquaSalGraphics::SetState() CGContextSetFillColor( mrContext, maFillColor.AsArray() ); CGContextSetStrokeColor( mrContext, maLineColor.AsArray() ); CGContextSetShouldAntialias( mrContext, false ); + if( mnXorMode == 2 ) + CGContextSetBlendMode( mrContext, kCGBlendModeDifference ); } // ---------------------------------------------------------------------- diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 0bbc190de546..ef6258829261 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -48,6 +48,8 @@ #include "com/sun/star/container/XNameAccess.hpp" #include "com/sun/star/beans/PropertyValue.hpp" +#include <algorithm> + using namespace rtl; using namespace vcl; using namespace com::sun::star::uno; @@ -122,11 +124,12 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const long nDPIX = 720, nDPIY = 720; NSSize aPaperSize = [mpPrintInfo paperSize]; + NSRect aImageRect = [mpPrintInfo imageablePageBounds]; if( mePageOrientation == ORIENTATION_PORTRAIT ) { double dX = 0, dY = aPaperSize.height; - dX += [mpPrintInfo leftMargin]; - dY -= [mpPrintInfo topMargin]; + dX += aImageRect.origin.x; + dY -= aPaperSize.height - aImageRect.size.height - aImageRect.origin.y; CGContextTranslateCTM( i_rContext, dX + mnStartPageOffsetX, dY - mnStartPageOffsetY ); CGContextScaleCTM( i_rContext, 0.1, -0.1 ); } @@ -134,8 +137,8 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const { CGContextRotateCTM( i_rContext, M_PI/2 ); double dX = aPaperSize.height, dY = -aPaperSize.width; - dY += [mpPrintInfo topMargin]; - dX -= [mpPrintInfo rightMargin]; + dY += aPaperSize.height - aImageRect.size.height - aImageRect.origin.y; + dX -= aImageRect.origin.x; CGContextTranslateCTM( i_rContext, dX + mnStartPageOffsetY, dY - mnStartPageOffsetX ); CGContextScaleCTM( i_rContext, -0.1, 0.1 ); @@ -440,10 +443,19 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, NSSize aPaperSize = [mpPrintInfo paperSize]; o_rPageWidth = static_cast<long>( double(aPaperSize.width) * fXScaling ); o_rPageHeight = static_cast<long>( double(aPaperSize.height) * fYScaling ); - o_rPageOffX = static_cast<long>( [mpPrintInfo leftMargin] * fXScaling ); - o_rPageOffY = static_cast<long>( [mpPrintInfo topMargin] * fYScaling ); - o_rOutWidth = static_cast<long>( o_rPageWidth - double([mpPrintInfo leftMargin] + [mpPrintInfo rightMargin]) * fXScaling ); - o_rOutHeight = static_cast<long>( o_rPageHeight - double([mpPrintInfo topMargin] + [mpPrintInfo bottomMargin]) * fYScaling ); + + NSRect aImageRect = [mpPrintInfo imageablePageBounds]; + o_rPageOffX = static_cast<long>( aImageRect.origin.x * fXScaling ); + o_rPageOffY = static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ); + o_rOutWidth = static_cast<long>( aImageRect.size.width * fXScaling ); + o_rOutHeight = static_cast<long>( aImageRect.size.height * fYScaling ); + + if( mePageOrientation == ORIENTATION_LANDSCAPE ) + { + std::swap( o_rOutWidth, o_rOutHeight ); + std::swap( o_rPageWidth, o_rPageHeight ); + std::swap( o_rPageOffX, o_rPageOffY ); + } } } diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 77e7222bdec1..00b91fa66456 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -1153,7 +1153,13 @@ private: return 0; } +#ifdef MAC_OS_X_VERSION_10_5 +/* build target 10.5 or greater */ +- (NSInteger)conversationIdentifier +#else +/* build target 10.4 */ - (long)conversationIdentifier +#endif { return (long)self; } diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index e8d4b6ad40a2..c460b2c8cc1e 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -369,10 +369,10 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR // adjust frame rect when necessary USHORT nArrangeIndex; Point position = pWin->ImplCalcPos( pWin, rRect, nFlags, nArrangeIndex ); - if( position.nB < rRect.nTop ) { + if( position.Y() < rRect.nTop ) { displayPopupFrame.origin.y += ( lineHeight*drawnItems ); } - if( position.nA < rRect.nLeft ) { + if( position.X() < rRect.nLeft ) { displayPopupFrame.origin.x -= popupFrame.size.width; } diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx index 968acd1ae6bb..534d63b3427c 100644 --- a/vcl/inc/vcl/edit.hxx +++ b/vcl/inc/vcl/edit.hxx @@ -97,7 +97,7 @@ private: DECL_DLLPRIVATE_LINK( ImplUpdateDataHdl, Timer* ); - SAL_DLLPRIVATE void ImplTruncateToMaxLen( rtl::OUString&, sal_uInt32 nSelectionLen ) const; + SAL_DLLPRIVATE bool ImplTruncateToMaxLen( rtl::OUString&, sal_uInt32 nSelectionLen ) const; SAL_DLLPRIVATE void ImplInitEditData(); SAL_DLLPRIVATE void ImplModified(); SAL_DLLPRIVATE XubString ImplGetText() const; diff --git a/vcl/inc/vcl/msgbox.hxx b/vcl/inc/vcl/msgbox.hxx index c80a71b42cb9..1d31ab722f29 100644 --- a/vcl/inc/vcl/msgbox.hxx +++ b/vcl/inc/vcl/msgbox.hxx @@ -129,6 +129,7 @@ public: InfoBox( Window* pParent, const ResId & rResId ); static Image GetStandardImage(); + static Image GetStandardImageHC(); }; // -------------- @@ -148,6 +149,7 @@ public: void SetDefaultCheckBoxText(); static Image GetStandardImage(); + static Image GetStandardImageHC(); }; // ------------ @@ -165,6 +167,7 @@ public: ErrorBox( Window* pParent, const ResId& rResId ); static Image GetStandardImage(); + static Image GetStandardImageHC(); }; // ------------ @@ -184,6 +187,7 @@ public: void SetDefaultCheckBoxText(); static Image GetStandardImage(); + static Image GetStandardImageHC(); }; #endif // _SV_MSGBOX_HXX diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index b651a8d02ade..16ff921ba003 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -214,7 +214,7 @@ public: // filled accordingly virtual void SetFillColor( SalColor nSalColor ) = 0; // enable/disable XOR drawing - virtual void SetXORMode( BOOL bSet ) = 0; + virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0; // set line color for raster operations virtual void SetROPLineColor( SalROPColor nROPColor ) = 0; // set fill color for raster operations @@ -343,7 +343,10 @@ public: BOOL mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const; void mirror( Rectangle& rRect, const OutputDevice*, bool bBack = false ) const; void mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack = false ) const; - void mirror(ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const; + void mirror( ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const; + basegfx::B2DPoint mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice *pOutDev, bool bBack = false ) const; + basegfx::B2DPolygon mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const; + basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const; // non virtual methods; these do eventual coordinate mirroring and // then delegate to protected virtual methods diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx index 536f629bfa9e..a7f34ee5dd56 100644 --- a/vcl/inc/vcl/svdata.hxx +++ b/vcl/inc/vcl/svdata.hxx @@ -223,7 +223,8 @@ struct ImplSVWinData Window* mpExtTextInputWin; // Window, which is in ExtTextInput Window* mpTrackWin; // window, that is in tracking mode AutoTimer* mpTrackTimer; // tracking timer - ImageList* mpMsgBoxImgList; // ImageList for MessageBoxen + ImageList* mpMsgBoxImgList; // ImageList for MessageBox + ImageList* mpMsgBoxHCImgList; // ImageList for MessageBox (high contrast mode) Window* mpAutoScrollWin; // window, that is in AutoScrollMode mode USHORT mnTrackFlags; // tracking flags USHORT mnAutoScrollFlags; // auto scroll flags diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc index 47654c33bfd5..48297a04ea0e 100644 --- a/vcl/inc/vcl/svids.hrc +++ b/vcl/inc/vcl/svids.hrc @@ -44,6 +44,7 @@ #define SV_RESID_BITMAP_RADIO 1010 #define SV_RESID_BITMAP_MSGBOX 1020 +#define SV_RESID_BITMAP_MSGBOX_HC 1021 #define SV_RESID_BITMAP_PIN 1030 diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index 1a82e068b434..6f319a32064e 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -137,7 +137,7 @@ public: BOOL mbVirDev; // is VirDev BOOL mbWindow; // is Window BOOL mbScreen; // is Screen compatible - BOOL mbXORMode; // _every_ output with RasterOp XOR + bool mbXORMode; // _every_ output with RasterOp XOR ULONG mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks ImplOs2FontData* mpOs2FontData[ MAX_FALLBACK ]; // pointer to the most recent font face ImplOs2FontEntry* mpOs2FontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance @@ -242,7 +242,7 @@ public: // filled accordingly virtual void SetFillColor( SalColor nSalColor ); // enable/disable XOR drawing - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); // set line color for raster operations virtual void SetROPLineColor( SalROPColor nROPColor ); // set fill color for raster operations diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx index ad764f850500..04516cf1d0f5 100644 --- a/vcl/os2/source/gdi/salgdi.cxx +++ b/vcl/os2/source/gdi/salgdi.cxx @@ -344,7 +344,7 @@ void Os2SalGraphics::SetFillColor( SalColor nSalColor ) // ----------------------------------------------------------------------- -void Os2SalGraphics::SetXORMode( BOOL bSet ) +void Os2SalGraphics::SetXORMode( bool bSet, bool ) { mbXORMode = bSet; LONG nMixMode = bSet ? FM_XOR : FM_OVERPAINT; diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index e1ca08cfbd65..e9dbe16f1fcf 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -410,6 +410,11 @@ void DeInitVCL() delete pSVData->maWinData.mpMsgBoxImgList; pSVData->maWinData.mpMsgBoxImgList = NULL; } + if ( pSVData->maWinData.mpMsgBoxHCImgList ) + { + delete pSVData->maWinData.mpMsgBoxHCImgList; + pSVData->maWinData.mpMsgBoxHCImgList = NULL; + } if ( pSVData->maCtrlData.mpCheckImgList ) { delete pSVData->maCtrlData.mpCheckImgList; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 8754aaabf3a9..93e707fc562c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -840,16 +840,18 @@ void Edit::ShowTruncationWarning( Window* pParent ) // ----------------------------------------------------------------------- -void Edit::ImplTruncateToMaxLen( rtl::OUString& rStr, sal_uInt32 nSelectionLen ) const +bool Edit::ImplTruncateToMaxLen( rtl::OUString& rStr, sal_uInt32 nSelectionLen ) const { + bool bWasTruncated = false; const sal_uInt32 nMaxLen = mnMaxTextLen < 65534 ? mnMaxTextLen : 65534; sal_uInt32 nLenAfter = static_cast<sal_uInt32>(maText.Len()) + rStr.getLength() - nSelectionLen; if ( nLenAfter > nMaxLen ) { sal_uInt32 nErasePos = nMaxLen - static_cast<sal_uInt32>(maText.Len()) + nSelectionLen; rStr = rStr.copy( 0, nErasePos ); - ShowTruncationWarning( const_cast<Edit*>(this) ); + bWasTruncated = true; } + return bWasTruncated; } // ----------------------------------------------------------------------- @@ -1410,7 +1412,8 @@ void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC uno::Any aData = xDataObj->getTransferData( aFlavor ); ::rtl::OUString aText; aData >>= aText; - ImplTruncateToMaxLen( aText, maSelection.Len() ); + if( ImplTruncateToMaxLen( aText, maSelection.Len() ) ) + ShowTruncationWarning( const_cast<Edit*>(this) ); ReplaceSelected( aText ); } catch( const ::com::sun::star::uno::Exception& ) diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 750599ef2aaa..a5a9886bd7a3 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -93,32 +93,29 @@ Image::Image( const ResId& rResId ) : pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) ); } - if( !aBmpEx.IsEmpty() ) + if( nObjMask & RSC_IMAGE_MASKBITMAP ) { - if( nObjMask & RSC_IMAGE_MASKBITMAP ) + if( !aBmpEx.IsEmpty() && aBmpEx.GetTransparentType() == TRANSPARENT_NONE ) { - if( aBmpEx.GetTransparentType() == TRANSPARENT_NONE ) - { - const Bitmap aMaskBitmap( ResId( (RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ); - aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMaskBitmap ); - } - - pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) ); + const Bitmap aMaskBitmap( ResId( (RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ); + aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMaskBitmap ); } - if( nObjMask & RSC_IMAGE_MASKCOLOR ) - { - if( aBmpEx.GetTransparentType() == TRANSPARENT_NONE ) - { - const Color aMaskColor( ResId( (RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ); - aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMaskColor ); - } + pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) ); + } - pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) ); + if( nObjMask & RSC_IMAGE_MASKCOLOR ) + { + if( !aBmpEx.IsEmpty() && aBmpEx.GetTransparentType() == TRANSPARENT_NONE ) + { + const Color aMaskColor( ResId( (RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ); + aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMaskColor ); } - ImplInit( aBmpEx ); + pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) ); } + if( ! aBmpEx.IsEmpty() ) + ImplInit( aBmpEx ); } } diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index c96315324a2d..0d93b538338b 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -766,7 +766,7 @@ int OutputDevice::ImplGetGraphics() const if ( mpGraphics ) { - mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp) ); + mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp ); return TRUE; } @@ -1970,7 +1970,7 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp ) mbInitLineColor = mbInitFillColor = TRUE; if( mpGraphics || ImplGetGraphics() ) - mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp) ); + mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp ); } if( mpAlphaVDev ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 987f8a3d275d..f4ead6d82db9 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4091,19 +4091,27 @@ we check in the following sequence: sal_Int32 nSetGoToRMode = 0; sal_Bool bTargetHasPDFExtension = sal_False; INetProtocol eTargetProtocol = aTargetURL.GetProtocol(); + sal_Bool bIsUNCPath = sal_False; // check if the protocol is a known one, or if there is no protocol at all (on target only) // if there is no protocol, make the target relative to the current document directory // getting the needed URL information from the current document path if( eTargetProtocol == INET_PROT_NOT_VALID ) { - INetURLObject aNewBase( aDocumentURL );//duplicate document URL - aNewBase.removeSegment(); //remove last segment from it, obtaining the base URL of the - //target document - aNewBase.insertName( rLink.m_aURL ); - aTargetURL = aNewBase;//reassign the new target URL + if( rLink.m_aURL.getLength() > 4 && rLink.m_aURL.compareToAscii( "\\\\\\\\", 4 ) == 0) + { + bIsUNCPath = sal_True; + } + else + { + INetURLObject aNewBase( aDocumentURL );//duplicate document URL + aNewBase.removeSegment(); //remove last segment from it, obtaining the base URL of the + //target document + aNewBase.insertName( rLink.m_aURL ); + aTargetURL = aNewBase;//reassign the new target URL //recompute the target protocol, with the new URL //normal URL processing resumes - eTargetProtocol = aTargetURL.GetProtocol(); + eTargetProtocol = aTargetURL.GetProtocol(); + } } rtl::OUString aFileExtension = aTargetURL.GetFileExtension(); @@ -4141,21 +4149,30 @@ we check in the following sequence: INetProtocol eBaseProtocol = aDocumentURL.GetProtocol(); //queue the string common to all types of actions aLine.append( "/A<</Type/Action/S"); - sal_Int32 nSetRelative = 0; + if( bIsUNCPath ) // handle Win UNC paths + { + aLine.append( "/Launch/Win<</F" ); + // INetURLObject is not good with UNC paths, use original path + appendLiteralStringEncrypt( rLink.m_aURL, rLink.m_nObject, aLine ); + aLine.append( ">>" ); + } + else + { + sal_Int32 nSetRelative = 0; //check if relative file link is requested and if the protocol is 'file://' - if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE ) - nSetRelative++; + if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE ) + nSetRelative++; - rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is, - if( nSetGoToRMode == 0 ) - switch( m_aContext.DefaultLinkAction ) - { - default: - case PDFWriter::URIAction : - case PDFWriter::URIActionDestination : - aLine.append( "/URI/URI" ); - break; - case PDFWriter::LaunchAction: + rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is, + if( nSetGoToRMode == 0 ) + switch( m_aContext.DefaultLinkAction ) + { + default: + case PDFWriter::URIAction : + case PDFWriter::URIActionDestination : + aLine.append( "/URI/URI" ); + break; + case PDFWriter::LaunchAction: // now: // if a launch action is requested and the hyperlink target has a fragment // and the target file does not have a pdf extension, or it's not a 'file:://' protocol @@ -4163,50 +4180,51 @@ we check in the following sequence: // This code will permit the correct opening of application on web pages, the one that // normally have fragments (but I may be wrong...) // and will force the use of URI when the protocol is not file:// - if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) || - eTargetProtocol != INET_PROT_FILE ) - aLine.append( "/URI/URI" ); - else - aLine.append( "/Launch/F" ); - break; - } + if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) || + eTargetProtocol != INET_PROT_FILE ) + aLine.append( "/URI/URI" ); + else + aLine.append( "/Launch/F" ); + break; + } //fragment are encoded in the same way as in the named destination processing - rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET ); - if( nSetGoToRMode ) - {//add the fragment - aLine.append("/GoToR"); - aLine.append("/F"); - appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark, - INetURLObject::WAS_ENCODED, - INetURLObject::DECODE_WITH_CHARSET ) : - aURLNoMark, rLink.m_nObject, aLine ); - if( aFragment.getLength() > 0 ) - { - aLine.append("/D/"); - appendDestinationName( aFragment , aLine ); + rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET ); + if( nSetGoToRMode ) + {//add the fragment + aLine.append("/GoToR"); + aLine.append("/F"); + appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark, + INetURLObject::WAS_ENCODED, + INetURLObject::DECODE_WITH_CHARSET ) : + aURLNoMark, rLink.m_nObject, aLine ); + if( aFragment.getLength() > 0 ) + { + aLine.append("/D/"); + appendDestinationName( aFragment , aLine ); + } } - } - else - { + else + { // change the fragment to accomodate the bookmark (only if the file extension is PDF and // the requested action is of the correct type) - if(m_aContext.DefaultLinkAction == PDFWriter::URIActionDestination && - bTargetHasPDFExtension && aFragment.getLength() > 0 ) - { - OStringBuffer aLineLoc( 1024 ); - appendDestinationName( aFragment , aLineLoc ); + if(m_aContext.DefaultLinkAction == PDFWriter::URIActionDestination && + bTargetHasPDFExtension && aFragment.getLength() > 0 ) + { + OStringBuffer aLineLoc( 1024 ); + appendDestinationName( aFragment , aLineLoc ); //substitute the fragment - aTargetURL.SetMark( aLineLoc.getStr() ); - } - rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE ); + aTargetURL.SetMark( aLineLoc.getStr() ); + } + rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE ); // check if we have a URL available, if the string is empty, set it as the original one // if( aURL.getLength() == 0 ) // appendLiteralStringEncrypt( rLink.m_aURL , rLink.m_nObject, aLine ); // else - appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL ) : - aURL , rLink.m_nObject, aLine ); - } + appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL ) : + aURL , rLink.m_nObject, aLine ); + } //<--- i56629 + } aLine.append( ">>\n" ); } if( rLink.m_nStructParent > 0 ) @@ -5196,6 +5214,8 @@ bool PDFWriterImpl::emitCatalog() sal_Int32 nStructureDict = 0; if(m_aStructure.size() > 1) { +///check if dummy structure containers are needed + addInternalStructureContainer(m_aStructure[0]); nStructureDict = m_aStructure[0].m_nObject = createObject(); emitStructure( m_aStructure[ 0 ] ); } @@ -9021,7 +9041,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) { aLine.append( "[ /Indexed/DeviceRGB " ); aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) ); - aLine.append( " <\n" ); + aLine.append( "\n<" ); if( m_aContext.Encrypt ) { enableStringEncryption( rObject.m_nObject ); @@ -9046,14 +9066,10 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) appendHex(m_pEncryptionBuffer[nChar++], aLine ); appendHex(m_pEncryptionBuffer[nChar++], aLine ); appendHex(m_pEncryptionBuffer[nChar++], aLine ); - if( (i+1) & 15 ) - aLine.append( ' ' ); - else - aLine.append( "\n" ); } } } - else //no encryption requested + else //no encryption requested (PDF/A-1a program flow drops here) { for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ ) { @@ -9061,13 +9077,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) appendHex( rColor.GetRed(), aLine ); appendHex( rColor.GetGreen(), aLine ); appendHex( rColor.GetBlue(), aLine ); - if( (i+1) & 15 ) - aLine.append( ' ' ); - else - aLine.append( "\n" ); } } - aLine.append( "> ]\n" ); + aLine.append( ">\n]\n" ); } } else @@ -10501,6 +10513,108 @@ void PDFWriterImpl::endStructureElement() #endif } +//---> i94258 +/* + * This function adds an internal structure list container to overcome the 8191 elements array limitation + * in kids element emission. + * Recursive function + * + */ +void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle ) +{ + if( rEle.m_eType == PDFWriter::NonStructElement && + rEle.m_nOwnElement != rEle.m_nParentElement ) + return; + + for( std::list< sal_Int32 >::const_iterator it = rEle.m_aChildren.begin(); it != rEle.m_aChildren.end(); ++it ) + { + if( *it > 0 && *it < sal_Int32(m_aStructure.size()) ) + { + PDFStructureElement& rChild = m_aStructure[ *it ]; + if( rChild.m_eType != PDFWriter::NonStructElement ) + { + //triggered when a child of the rEle element is found + if( rChild.m_nParentElement == rEle.m_nOwnElement ) + addInternalStructureContainer( rChild );//examine the child + else + { + DBG_ERROR( "PDFWriterImpl::addInternalStructureContainer: invalid child structure element" ); +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure elemnt with id %" SAL_PRIdINT32 "\n", *it ); +#endif + } + } + } + else + { + DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure id" ); +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure id %" SAL_PRIdINT32 "\n", *it ); +#endif + } + } + + if( rEle.m_nOwnElement != rEle.m_nParentElement ) + { + if( !rEle.m_aKids.empty() ) + { + if( rEle.m_aKids.size() > ncMaxPDFArraySize ) { + //then we need to add the containers for the kids elements + // a list to be used for the new kid element + std::list< PDFStructureElementKid > aNewKids; + std::list< sal_Int32 > aNewChildren; + + // add Div in RoleMap, in case no one else did (TODO: is it needed? Is it dangerous?) + OStringBuffer aNameBuf( "Div" ); + OString aAliasName( aNameBuf.makeStringAndClear() ); + m_aRoleMap[ aAliasName ] = getStructureTag( PDFWriter::Division ); + + while( rEle.m_aKids.size() > ncMaxPDFArraySize ) + { + sal_Int32 nCurrentStructElement = rEle.m_nOwnElement; + sal_Int32 nNewId = sal_Int32(m_aStructure.size()); + m_aStructure.push_back( PDFStructureElement() ); + PDFStructureElement& rEleNew = m_aStructure.back(); + rEleNew.m_aAlias = aAliasName; + rEleNew.m_eType = PDFWriter::Division; // a new Div type container + rEleNew.m_nOwnElement = nNewId; + rEleNew.m_nParentElement = nCurrentStructElement; + //inherit the same page as the first child to be reparented + rEleNew.m_nFirstPageObject = m_aStructure[ rEle.m_aChildren.front() ].m_nFirstPageObject; + rEleNew.m_nObject = createObject();//assign a PDF object number + //add the object to the kid list of the parent + aNewKids.push_back( PDFStructureElementKid( rEleNew.m_nObject ) ); + aNewChildren.push_back( nNewId ); + + std::list< sal_Int32 >::iterator aChildEndIt( rEle.m_aChildren.begin() ); + std::list< PDFStructureElementKid >::iterator aKidEndIt( rEle.m_aKids.begin() ); + advance( aChildEndIt, ncMaxPDFArraySize ); + advance( aKidEndIt, ncMaxPDFArraySize ); + + rEleNew.m_aKids.splice( rEleNew.m_aKids.begin(), + rEle.m_aKids, + rEle.m_aKids.begin(), + aKidEndIt ); + rEleNew.m_aChildren.splice( rEleNew.m_aChildren.begin(), + rEle.m_aChildren, + rEle.m_aChildren.begin(), + aChildEndIt ); + // set the kid's new parent + for( std::list< sal_Int32 >::const_iterator it = rEleNew.m_aChildren.begin(); + it != rEleNew.m_aChildren.end(); ++it ) + { + m_aStructure[ *it ].m_nParentElement = nNewId; + } + } + //finally add the new kids resulting from the container added + rEle.m_aKids.insert( rEle.m_aKids.begin(), aNewKids.begin(), aNewKids.end() ); + rEle.m_aChildren.insert( rEle.m_aChildren.begin(), aNewChildren.begin(), aNewChildren.end() ); + } + } + } +} +//<--- i94258 + bool PDFWriterImpl::setCurrentStructureElement( sal_Int32 nEle ) { bool bSuccess = false; diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 8bfaa121dab8..dcdd7cab4721 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -474,7 +474,7 @@ public: sal_Int32 m_nParentElement; // index into structure vector sal_Int32 m_nFirstPageObject; bool m_bOpenMCSeq; - std::list< sal_Int32 > m_aChildren; // indices into strucure vector + std::list< sal_Int32 > m_aChildren; // indexes into structure vector std::list< PDFStructureElementKid > m_aKids; PDFStructAttributes m_aAttributes; Rectangle m_aBBox; @@ -949,6 +949,12 @@ i12626 // puts the attribute objects of a structure element into the returned string, // helper for emitStructure rtl::OString emitStructureAttributes( PDFStructureElement& rEle ); + //--->i94258 + // the maximum array elements allowed for PDF array object + static const sal_uInt32 ncMaxPDFArraySize = 8191; + //check if internal dummy container are needed in the structure elements + void addInternalStructureContainer( PDFStructureElement& rEle ); + //<---i94258 // writes document structure sal_Int32 emitStructure( PDFStructureElement& rEle ); // writes structure parent tree diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 298da07de1b2..0c266079c277 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -52,13 +52,12 @@ #include <vcl/gdimtf.hxx> #include <vcl/outdata.hxx> #include <vcl/print.hxx> -#ifndef _VCL_IMPLNCVT_HXX #include <implncvt.hxx> -#endif #include <vcl/outdev.h> #include <vcl/outdev.hxx> #include <vcl/unowrap.hxx> #include <vcl/sallayout.hxx> +#include "basegfx/polygon/b2dpolygon.hxx" //#define USE_NEW_RTL_IMPLEMENTATION @@ -245,6 +244,89 @@ void SalGraphics::mirror( Rectangle& rRect, const OutputDevice *pOutDev, bool bB rRect.Move( x - x_org, 0 ); } +basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice *i_pOutDev, bool i_bBack ) const +{ + long w; + if( i_pOutDev && i_pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) + w = i_pOutDev->GetOutputWidthPixel(); + else + w = GetGraphicsWidth(); + + DBG_ASSERT( w, "missing graphics width" ); + + basegfx::B2DPoint aRet( i_rPoint ); + if( w ) + { + if( i_pOutDev && !i_pOutDev->IsRTLEnabled() ) + { + OutputDevice *pOutDevRef = (OutputDevice*)i_pOutDev; + // mirror this window back + double devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX + if( i_bBack ) + aRet.setX( i_rPoint.getX() - devX + pOutDevRef->GetOutOffXPixel() ); + else + aRet.setX( devX + (i_rPoint.getX() - pOutDevRef->GetOutOffXPixel()) ); + } + else + aRet.setX( w-1-i_rPoint.getX() ); + } + return aRet; +} + +basegfx::B2DPolygon SalGraphics::mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *i_pOutDev, bool i_bBack ) const +{ + long w; + if( i_pOutDev && i_pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) + w = i_pOutDev->GetOutputWidthPixel(); + else + w = GetGraphicsWidth(); + + DBG_ASSERT( w, "missing graphics width" ); + + basegfx::B2DPolygon aRet; + if( w ) + { + sal_Int32 nPoints = i_rPoly.count(); + for( sal_Int32 i = 0; i < nPoints; i++ ) + { + aRet.append( mirror( i_rPoly.getB2DPoint( i ), i_pOutDev, i_bBack ) ); + if( i_rPoly.isPrevControlPointUsed( i ) ) + aRet.setPrevControlPoint( i, mirror( i_rPoly.getPrevControlPoint( i ), i_pOutDev, i_bBack ) ); + if( i_rPoly.isNextControlPointUsed( i ) ) + aRet.setNextControlPoint( i, mirror( i_rPoly.getNextControlPoint( i ), i_pOutDev, i_bBack ) ); + } + aRet.setClosed( i_rPoly.isClosed() ); + aRet.flip(); + } + else + aRet = i_rPoly; + return aRet; +} + +basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *i_pOutDev, bool i_bBack ) const +{ + long w; + if( i_pOutDev && i_pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) + w = i_pOutDev->GetOutputWidthPixel(); + else + w = GetGraphicsWidth(); + + DBG_ASSERT( w, "missing graphics width" ); + + basegfx::B2DPolyPolygon aRet; + if( w ) + { + sal_Int32 nPoly = i_rPoly.count(); + for( sal_Int32 i = 0; i < nPoly; i++ ) + aRet.append( mirror( i_rPoly.getB2DPolygon( i ), i_pOutDev, i_bBack ) ); + aRet.setClosed( i_rPoly.isClosed() ); + aRet.flip(); + } + else + aRet = i_rPoly; + return aRet; +} + // ---------------------------------------------------------------------------- BOOL SalGraphics::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ) @@ -299,6 +381,7 @@ bool SalGraphics::drawPolyLine( { return false; } + void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) @@ -311,7 +394,8 @@ void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const Out else drawPolyLine( nPoints, pPtAry ); } -void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev ) + +void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) { @@ -323,7 +407,8 @@ void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const O else drawPolygon( nPoints, pPtAry ); } -void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev ) + +void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev ) { if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) { @@ -346,38 +431,95 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint else drawPolyPolygon( nPoly, pPoints, pPtAry ); } -bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency, const OutputDevice* ) + +bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon& i_rPolyPolygon, double i_fTransparency, const OutputDevice* i_pOutDev ) { - DBG_ASSERT( !(m_nLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolyPolygon - no mirroring implemented"); - return drawPolyPolygon( rPolyPolygon, fTransparency ); + bool bRet = false; + if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) + { + basegfx::B2DPolyPolygon aMirror( mirror( i_rPolyPolygon, i_pOutDev ) ); + bRet = drawPolyPolygon( aMirror, i_fTransparency ); + } + else + bRet = drawPolyPolygon( i_rPolyPolygon, i_fTransparency ); + return bRet; } + bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fTransparency*/) { return false; } -sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* ) + +sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev ) { - DBG_ASSERT( !(m_nLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolyLineBezier - no mirroring implemented"); - return drawPolyLineBezier( nPoints, pPtAry, pFlgAry ); + sal_Bool bResult = sal_False; + if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) + { + SalPoint* pPtAry2 = new SalPoint[nPoints]; + BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev ); + bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry ); + delete [] pPtAry2; + } + else + bResult = drawPolyLineBezier( nPoints, pPtAry, pFlgAry ); + return bResult; } -sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* ) + +sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev ) { - DBG_ASSERT( !(m_nLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolygonBezier - no mirroring implemented"); - return drawPolygonBezier( nPoints, pPtAry, pFlgAry ); + sal_Bool bResult = sal_False; + if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) + { + SalPoint* pPtAry2 = new SalPoint[nPoints]; + BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev ); + bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry ); + delete [] pPtAry2; + } + else + bResult = drawPolygonBezier( nPoints, pPtAry, pFlgAry ); + return bResult; } -sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, const BYTE* const* pFlgAry, const OutputDevice* ) + +sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints, + const SalPoint* const* i_pPtAry, const BYTE* const* i_pFlgAry, const OutputDevice* i_pOutDev ) { - DBG_ASSERT( !(m_nLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolyPolygonBezier - no mirroring implemented"); - return drawPolyPolygonBezier( nPoly, pPoints, pPtAry, pFlgAry ); + sal_Bool bRet = sal_False; + if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) + { + // TODO: optimize, reduce new/delete calls + SalPoint **pPtAry2 = new SalPoint*[i_nPoly]; + ULONG i; + for(i=0; i<i_nPoly; i++) + { + ULONG nPoints = i_pPoints[i]; + pPtAry2[i] = new SalPoint[ nPoints ]; + mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev ); + } + + bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, (PCONSTSALPOINT*)pPtAry2, i_pFlgAry ); + + for(i=0; i<i_nPoly; i++) + delete [] pPtAry2[i]; + delete [] pPtAry2; + } + else + bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, i_pPtAry, i_pFlgAry ); + return bRet; } -bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& rPolygon, - const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin, - const OutputDevice* ) +bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, + const ::basegfx::B2DVector& i_rLineWidth, basegfx::B2DLineJoin i_eLineJoin, + const OutputDevice* i_pOutDev ) { - DBG_ASSERT( !(m_nLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolygon for B2D - no mirroring implemented"); - return drawPolyLine( rPolygon, rLineWidth, eLineJoin ); + bool bRet = false; + if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) + { + basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) ); + bRet = drawPolyLine( aMirror, i_rLineWidth, i_eLineJoin ); + } + else + bRet = drawPolyLine( i_rPolygon, i_rLineWidth, i_eLineJoin ); + return bRet; } void SalGraphics::CopyArea( long nDestX, long nDestY, diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src index 44ab1e4f70ee..a2b057c8d234 100644 --- a/vcl/source/src/images.src +++ b/vcl/source/src/images.src @@ -112,7 +112,14 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET) Bitmap SV_RESID_BITMAP_MSGBOX { - File = "msgbox.bmp"; + File = "msgbox.png"; +}; + +// ----------------------------------------------------------------------- + +Bitmap SV_RESID_BITMAP_MSGBOX_HC +{ + File = "msgbox_hc.png"; }; // ----------------------------------------------------------------------- diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index fa2ba198a755..b5f1ada74a98 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -768,6 +768,8 @@ void ImplPopupFloatWin::MouseButtonDown( const MouseEvent& rMEvt ) { // get mouse pos at a static window to have a fixed reference point PointerState aState = GetParent()->GetPointerState(); + if (ImplHasMirroredGraphics() && IsRTLEnabled()) + ImplMirrorFramePos(aState.maPos); maTearOffPosition = GetWindow( WINDOW_BORDER )->GetPosPixel(); maDelta = aState.maPos - maTearOffPosition; } @@ -786,6 +788,8 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt ) { // move the window according to mouse pos PointerState aState = GetParent()->GetPointerState(); + if (ImplHasMirroredGraphics() && IsRTLEnabled()) + ImplMirrorFramePos(aState.maPos); maTearOffPosition = aState.maPos - maDelta; GetWindow( WINDOW_BORDER )->SetPosPixel( maTearOffPosition ); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 69d422fe372b..87eebae0412d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2291,7 +2291,7 @@ Size Menu::ImplCalcSize( Window* pWin ) for ( USHORT i = (USHORT)pItemList->Count(); i; ) { MenuItemData* pData = pItemList->GetDataFromPos( --i ); - if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )) + if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))) { Size aImgSz = pData->aImage.GetSizePixel(); if ( aImgSz.Height() > aMaxImgSz.Height() ) @@ -3577,7 +3577,15 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( GetItemCount() ) { SalMenu* pMenu = ImplGetSalMenu(); - if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) + Rectangle aNativeRect( aRect ); + if( pW->IsRTLEnabled() ) + { + Point aPt( aRect.TopLeft() ); + aPt.X() += aSz.Width(); + pW->ImplMirrorFramePos( aPt ); + aNativeRect = Rectangle( aPt, aNativeRect.GetSize() ); + } + if( pMenu && pMenu->ShowNativePopupMenu( pWin, aNativeRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) { pWin->StopExecute(0); pWin->doShutdown(); diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index b7124506e5e8..bd727092a836 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -58,15 +58,17 @@ static void ImplInitMsgBoxImageList() ImplSVData* pSVData = ImplGetSVData(); if ( !pSVData->maWinData.mpMsgBoxImgList ) { - BitmapEx aBmpEx; ResMgr* pResMgr = ImplGetResMgr(); pSVData->maWinData.mpMsgBoxImgList = new ImageList(4); + pSVData->maWinData.mpMsgBoxHCImgList = new ImageList(4); if( pResMgr ) { Color aNonAlphaMask( 0xC0, 0xC0, 0xC0 ); pSVData->maWinData.mpMsgBoxImgList->InsertFromHorizontalBitmap ( ResId( SV_RESID_BITMAP_MSGBOX, *pResMgr ), 4, &aNonAlphaMask ); - } + pSVData->maWinData.mpMsgBoxHCImgList->InsertFromHorizontalBitmap + ( ResId( SV_RESID_BITMAP_MSGBOX_HC, *pResMgr ), 4, &aNonAlphaMask ); + } } } @@ -498,7 +500,8 @@ void InfoBox::ImplInitInfoBoxData() if ( !GetText().Len() ) SetText( Application::GetDisplayName() ); - SetImage( InfoBox::GetStandardImage() ); + SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ? + InfoBox::GetStandardImageHC() : InfoBox::GetStandardImage() ); mnSoundType = ((USHORT)SOUND_INFO)+1; } @@ -528,6 +531,14 @@ Image InfoBox::GetStandardImage() // ----------------------------------------------------------------------- +Image InfoBox::GetStandardImageHC() +{ + ImplInitMsgBoxImageList(); + return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 4 ); +} + +// ----------------------------------------------------------------------- + void WarningBox::ImplInitWarningBoxData() { // Default Text is the display title from the application @@ -580,7 +591,8 @@ void ErrorBox::ImplInitErrorBoxData() if ( !GetText().Len() ) SetText( Application::GetDisplayName() ); - SetImage( ErrorBox::GetStandardImage() ); + SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ? + ErrorBox::GetStandardImageHC() : ErrorBox::GetStandardImage() ); mnSoundType = ((USHORT)SOUND_ERROR)+1; } @@ -611,13 +623,22 @@ Image ErrorBox::GetStandardImage() // ----------------------------------------------------------------------- +Image ErrorBox::GetStandardImageHC() +{ + ImplInitMsgBoxImageList(); + return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 1 ); +} + +// ----------------------------------------------------------------------- + void QueryBox::ImplInitQueryBoxData() { // Default Text is the display title from the application if ( !GetText().Len() ) SetText( Application::GetDisplayName() ); - SetImage( QueryBox::GetStandardImage() ); + SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ? + QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() ); mnSoundType = ((USHORT)SOUND_QUERY)+1; } @@ -654,6 +675,16 @@ Image QueryBox::GetStandardImage() return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 2 ); } +// ----------------------------------------------------------------------- + +Image QueryBox::GetStandardImageHC() +{ + ImplInitMsgBoxImageList(); + return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 2 ); +} + +// ----------------------------------------------------------------------- + Size MessBox::GetOptimalSize(WindowSizeType eType) const { switch( eType ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 3fdc789bf781..a493fd427baa 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -100,6 +100,8 @@ #include "vcl/pdfextoutdevdata.hxx" #include "vcl/lazydelete.hxx" +#include <set> + using namespace rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -380,10 +382,25 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) if( defFontheight > maxFontheight ) defFontheight = maxFontheight; - // if the UI is korean, always use 9pt + // if the UI is korean, chinese or another locale + // where the system font size is kown to be often too small to + // generate readable fonts enforce a minimum font size of 9 points + bool bBrokenLangFontHeight = false; + static const LanguageType eBrokenSystemFontSizeLanguages[] = + { LANGUAGE_KOREAN, LANGUAGE_KOREAN_JOHAB, + LANGUAGE_CHINESE_HONGKONG, LANGUAGE_CHINESE_MACAU, LANGUAGE_CHINESE_SIMPLIFIED, LANGUAGE_CHINESE_SINGAPORE, LANGUAGE_CHINESE_TRADITIONAL + }; + static std::set< LanguageType > aBrokenSystemFontSizeLanguagesSet( + eBrokenSystemFontSizeLanguages, + eBrokenSystemFontSizeLanguages + + (sizeof(eBrokenSystemFontSizeLanguages)/sizeof(eBrokenSystemFontSizeLanguages[0])) + ); LanguageType aLang = Application::GetSettings().GetUILanguage(); - if( aLang == LANGUAGE_KOREAN || aLang == LANGUAGE_KOREAN_JOHAB ) + if( aBrokenSystemFontSizeLanguagesSet.find( aLang ) != aBrokenSystemFontSizeLanguagesSet.end() ) + { defFontheight = Max(9, defFontheight); + bBrokenLangFontHeight = true; + } // i22098, toolfont will be scaled differently to avoid bloated rulers and status bars for big fonts int toolfontheight = defFontheight; @@ -393,18 +410,28 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) aFont = aStyleSettings.GetAppFont(); aFont.SetHeight( defFontheight ); aStyleSettings.SetAppFont( aFont ); - //aFont = aStyleSettings.GetHelpFont(); - //aFont.SetHeight( defFontheight ); - //aStyleSettings.SetHelpFont( aFont ); aFont = aStyleSettings.GetTitleFont(); aFont.SetHeight( defFontheight ); aStyleSettings.SetTitleFont( aFont ); aFont = aStyleSettings.GetFloatTitleFont(); aFont.SetHeight( defFontheight ); aStyleSettings.SetFloatTitleFont( aFont ); - //aFont = aStyleSettings.GetMenuFont(); - //aFont.SetHeight( defFontheight ); - //aStyleSettings.SetMenuFont( aFont ); + // keep menu and help font size from system unless in broken locale size + if( bBrokenLangFontHeight ) + { + aFont = aStyleSettings.GetMenuFont(); + if( aFont.GetHeight() < defFontheight ) + { + aFont.SetHeight( defFontheight ); + aStyleSettings.SetMenuFont( aFont ); + } + aFont = aStyleSettings.GetHelpFont(); + if( aFont.GetHeight() < defFontheight ) + { + aFont.SetHeight( defFontheight ); + aStyleSettings.SetHelpFont( aFont ); + } + } // use different height for toolfont aFont = aStyleSettings.GetToolFont(); diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 1d430530ea07..91f4b3280448 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -640,6 +640,8 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) break; case VCLEVENT_OBJECT_DYING: + g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow() ); + // fallthrough intentional ! case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); break; diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 0c7b28d1027b..d0618328e59c 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -571,11 +571,12 @@ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP ((nType == CTRL_TOOLTIP) && ( (nPart==PART_ENTIRE_CONTROL) ) ) || ((nType == CTRL_MENU_POPUP) && - ( (nPart==PART_ENTIRE_CONTROL) ) + ( (nPart==PART_ENTIRE_CONTROL) || (nPart==PART_MENU_ITEM) || (nPart==PART_MENU_ITEM_CHECK_MARK) || (nPart==PART_MENU_ITEM_RADIO_MARK) - ) || + ) + ) || ((nType == CTRL_PROGRESS) && ( (nPart == PART_ENTIRE_CONTROL) ) ) || diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 6f3879289976..4ee06961444a 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -219,7 +219,7 @@ void SvpSalGraphics::SetFillColor( SalColor nSalColor ) m_aFillColor = basebmp::Color( nSalColor ); } -void SvpSalGraphics::SetXORMode( BOOL bSet ) +void SvpSalGraphics::SetXORMode( bool bSet, bool ) { m_aDrawMode = bSet ? DrawMode_XOR : DrawMode_PAINT; } diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 353ef24a7f01..984a77cccfad 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -82,7 +82,7 @@ public: virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); virtual void SetROPLineColor( SalROPColor nROPColor ); virtual void SetROPFillColor( SalROPColor nROPColor ); diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 45a07f8bd558..12302c1bbae2 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -273,7 +273,7 @@ void PspGraphics::SetROPFillColor( SalROPColor ) DBG_ASSERT( 0, "Error: PrinterGfx::SetROPFillColor() not implemented" ); } -void PspGraphics::SetXORMode( BOOL bSet ) +void PspGraphics::SetXORMode( bool bSet, bool ) { (void)bSet; DBG_ASSERT( !bSet, "Error: PrinterGfx::SetXORMode() not implemented" ); diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 2469bdcebf1b..9cbbac446477 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -111,7 +111,7 @@ public: virtual void SetLineColor( SalColor nSalColor ); virtual void SetFillColor(); virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); virtual void SetROPLineColor( SalROPColor nROPColor ); virtual void SetROPFillColor( SalROPColor nROPColor ); diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index e8cf38dfc49e..c8c0abf29fd6 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -110,7 +110,7 @@ public: virtual void SetLineColor( SalColor nSalColor ); virtual void SetFillColor(); virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); virtual void SetROPLineColor( SalROPColor nROPColor ); virtual void SetROPFillColor( SalROPColor nROPColor ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index b3e1efbdab44..0a5028b764eb 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -130,7 +130,7 @@ protected: BOOL bInvert50GC_ : 1; // is Invert50 GC valid BOOL bStippleGC_ : 1; // is Stipple GC valid BOOL bTrackingGC_ : 1; // is Tracking GC valid - BOOL bXORMode_ : 1; // is ROP XOR Mode set + bool bXORMode_ : 1; // is ROP XOR Mode set BOOL bDitherBrush_ : 1; // is solid or tile void SetClipRegion( GC pGC, @@ -242,7 +242,7 @@ public: virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); virtual void SetROPLineColor( SalROPColor nROPColor ); virtual void SetROPFillColor( SalROPColor nROPColor ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 44c3e19f589f..2f40c6e6eb39 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -347,12 +347,9 @@ void PspGraphics::SetROPFillColor( SalROPColor ) DBG_ASSERT( 0, "Error: PrinterGfx::SetROPFillColor() not implemented" ); } -void PspGraphics::SetXORMode( BOOL -#ifdef DBG_UTIL -bSet -#endif -) +void PspGraphics::SetXORMode( bool bSet, bool ) { + (void)bSet; DBG_ASSERT( !bSet, "Error: PrinterGfx::SetXORMode() not implemented" ); } diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 54c4df3f2bb8..bc50f464269b 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -720,7 +720,7 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::SetXORMode( BOOL bSet ) +void X11SalGraphics::SetXORMode( bool bSet, bool ) { if( !bXORMode_ == bSet ) { diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index 8ae294c97d6d..d76977944c11 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -434,7 +434,7 @@ static const char * get_desktop_environment() static const char* autodetect_plugin() { const char * desktop = get_desktop_environment(); - const char * pRet = NULL; + const char * pRet = "gen"; // no server at all: dummy plugin if ( desktop == desktop_strings[DESKTOP_NONE] ) @@ -444,7 +444,13 @@ static const char* autodetect_plugin() else if( desktop == desktop_strings[DESKTOP_KDE] ) pRet = "kde"; else - pRet = "gen"; + { + // #i95296# use the much nicer looking gtk plugin + // on desktops that set gtk variables (e.g. XFCE) + static const char* pEnv = getenv( "GTK2_RC_FILES" ); + if( pEnv && *pEnv ) // check for existance and non emptiness + pRet = "gtk"; + } #if OSL_DEBUG_LEVEL > 1 std::fprintf( stderr, "plugin autodetection: %s\n", pRet ); diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 7211431ad4ca..157558f28125 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -996,7 +996,7 @@ void X11SalFrame::SetIcon( USHORT nIcon ) { const String& rWM( pDisplay_->getWMAdaptor()->getWindowManagerName() ); if( rWM.EqualsAscii( "KWin" ) ) // assume KDE is running - iconSize = 16; + iconSize = 48; static bool bGnomeIconSize = false; static bool bGnomeChecked = false; if( ! bGnomeChecked ) @@ -1018,7 +1018,7 @@ void X11SalFrame::SetIcon( USHORT nIcon ) XFree( pProps ); } if( bGnomeIconSize ) - iconSize = 20; + iconSize = 48; } XWMHints Hints; diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index a43efed328b0..b2f1158f91f5 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -165,7 +165,7 @@ public: BOOL mbVirDev; // is VirDev BOOL mbWindow; // is Window BOOL mbScreen; // is Screen compatible - BOOL mbXORMode; // _every_ output with RasterOp XOR + bool mbXORMode; // _every_ output with RasterOp XOR HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont ); @@ -263,7 +263,7 @@ public: // filled accordingly virtual void SetFillColor( SalColor nSalColor ); // enable/disable XOR drawing - virtual void SetXORMode( BOOL bSet ); + virtual void SetXORMode( bool bSet, bool ); // set line color for raster operations virtual void SetROPLineColor( SalROPColor nROPColor ); // set fill color for raster operations diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 29bf48081e60..100e338fb45d 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -1189,7 +1189,7 @@ void WinSalGraphics::SetFillColor( SalColor nSalColor ) // ----------------------------------------------------------------------- -void WinSalGraphics::SetXORMode( BOOL bSet ) +void WinSalGraphics::SetXORMode( bool bSet, bool ) { mbXORMode = bSet; ::SetROP2( mhDC, bSet ? R2_XORPEN : R2_COPYPEN ); |