diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-25 10:57:30 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-25 10:57:30 +0100 |
commit | c75ebe36ab82d55c30a2c4fd9c866812474566fa (patch) | |
tree | 92cfddcfd31583a7fecb34eb3e4ffaa197a96201 /vcl | |
parent | 7ca3f3c0a7b848e06b9c9d0bf1b0e44cd58937bf (diff) | |
parent | d26d7768d7315d783fd143765ae68bc802c4445b (diff) |
gridfixes: pulled and merged DEV300:m104
Diffstat (limited to 'vcl')
37 files changed, 321 insertions, 146 deletions
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 5e93839719b5..a41e5cf656ba 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -85,6 +85,7 @@ } +(void)unsetMouseFrame: (AquaSalFrame*)pFrame; -(id)initWithSalFrame: (AquaSalFrame*)pFrame; +-(AquaSalFrame*)getSalFrame; -(BOOL)acceptsFirstResponder; -(BOOL)acceptsFirstMouse: (NSEvent *)pEvent; -(BOOL)isOpaque; diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx index 01a58b171b02..103b6dc47d44 100644 --- a/vcl/aqua/source/dtrans/DropTarget.cxx +++ b/vcl/aqua/source/dtrans/DropTarget.cxx @@ -50,6 +50,8 @@ #include <Carbon/Carbon.h> #include <postmac.h> +#include <salframe.h> +#include <salframeview.h> using namespace rtl; using namespace cppu; @@ -60,6 +62,7 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants; using namespace com::sun::star::datatransfer::clipboard; using namespace com::sun::star::lang; using namespace com::sun::star::uno; +using namespace com::sun::star; using namespace comphelper; OUString dropTarget_getImplementationName() @@ -149,6 +152,8 @@ namespace /* private */ DropTarget::DropTarget() : WeakComponentImplHelper5<XInitialization, XDropTarget, XDropTargetDragContext, XDropTargetDropContext, XServiceInfo>(m_aMutex), + mView(nil), + mpFrame(NULL), mDropTargetHelper(nil), mbActive(false), mDragSourceSupportedActions(DNDConstants::ACTION_NONE), @@ -161,8 +166,9 @@ DropTarget::DropTarget() : DropTarget::~DropTarget() { - [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper]; - [mDropTargetHelper release]; + if( AquaSalFrame::isAlive( mpFrame ) ) + [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper]; + [mDropTargetHelper release]; } @@ -243,7 +249,7 @@ NSDragOperation DropTarget::draggingEntered(id sender) NSPasteboard* dragPboard = [sender draggingPasteboard]; mXCurrentDragClipboard = new AquaClipboard(dragPboard, false); - Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ? + uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ? DragSource::g_XTransferable : mXCurrentDragClipboard->getContents(); DropTargetDragEnterEvent dtdee(static_cast<OWeakObject*>(this), @@ -333,7 +339,7 @@ BOOL DropTarget::performDragOperation(id sender) if (mSelectedDropAction != DNDConstants::ACTION_NONE) { - Reference<XTransferable> xTransferable = DragSource::g_XTransferable; + uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable; if (!DragSource::g_XTransferable.is()) { @@ -370,7 +376,7 @@ BOOL DropTarget::performDragOperation(id sender) { mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE; - mXCurrentDragClipboard = Reference<XClipboard>(); + mXCurrentDragClipboard = uno::Reference<XClipboard>(); SetThemeCursor(kThemeArrowCursor); } @@ -396,6 +402,7 @@ BOOL DropTarget::performDragOperation(id sender) sal_uInt64 tmp = 0; pNSView >>= tmp; mView = (id)tmp; + mpFrame = [(SalFrameView*)mView getSalFrame]; mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this]; @@ -415,14 +422,14 @@ BOOL DropTarget::performDragOperation(id sender) } - void SAL_CALL DropTarget::addDropTargetListener(const Reference<XDropTargetListener>& dtl) + void SAL_CALL DropTarget::addDropTargetListener(const uno::Reference<XDropTargetListener>& dtl) throw(RuntimeException) { rBHelper.addListener(::getCppuType(&dtl), dtl); } - void SAL_CALL DropTarget::removeDropTargetListener(const Reference<XDropTargetListener>& dtl) + void SAL_CALL DropTarget::removeDropTargetListener(const uno::Reference<XDropTargetListener>& dtl) throw(RuntimeException) { rBHelper.removeListener(::getCppuType(&dtl), dtl); @@ -486,7 +493,7 @@ BOOL DropTarget::performDragOperation(id sender) { // Reset the internal transferable used as shortcut in case this is // an internal D&D operation - DragSource::g_XTransferable = Reference<XTransferable>(); + DragSource::g_XTransferable = uno::Reference<XTransferable>(); DragSource::g_DropSuccessSet = true; DragSource::g_DropSuccess = success; } @@ -494,13 +501,13 @@ BOOL DropTarget::performDragOperation(id sender) void DropTarget::fire_drop( const DropTargetDropEvent& dte) { - OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); + OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) ); if( pContainer) { OInterfaceIteratorHelper iter( *pContainer); while( iter.hasMoreElements()) { - Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); + uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); try { listener->drop( dte); } catch(RuntimeException&) {} @@ -511,13 +518,13 @@ BOOL DropTarget::performDragOperation(id sender) void DropTarget::fire_dragEnter(const DropTargetDragEnterEvent& e) { - OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); + OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) ); if( pContainer) { OInterfaceIteratorHelper iter( *pContainer); while( iter.hasMoreElements()) { - Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); + uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); try { listener->dragEnter( e); } catch (RuntimeException&) {} @@ -528,14 +535,14 @@ BOOL DropTarget::performDragOperation(id sender) void DropTarget::fire_dragExit(const DropTargetEvent& dte) { - OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); + OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) ); if( pContainer) { OInterfaceIteratorHelper iter( *pContainer); while( iter.hasMoreElements()) { - Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); + uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); try { listener->dragExit( dte); } catch (RuntimeException&) {} @@ -546,13 +553,13 @@ BOOL DropTarget::performDragOperation(id sender) void DropTarget::fire_dragOver(const DropTargetDragEvent& dtde) { - OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); + OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) ); if( pContainer) { OInterfaceIteratorHelper iter( *pContainer ); while( iter.hasMoreElements()) { - Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); + uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); try { listener->dragOver( dtde); } catch (RuntimeException&) {} @@ -563,13 +570,13 @@ BOOL DropTarget::performDragOperation(id sender) void DropTarget::fire_dropActionChanged(const DropTargetDragEvent& dtde) { - OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); + OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) ); if( pContainer) { OInterfaceIteratorHelper iter( *pContainer); while( iter.hasMoreElements()) { - Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); + uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next())); try { listener->dropActionChanged( dtde); } catch (RuntimeException&) {} diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx index 231df7fd5157..77e2a08c5de7 100644 --- a/vcl/aqua/source/dtrans/DropTarget.hxx +++ b/vcl/aqua/source/dtrans/DropTarget.hxx @@ -51,6 +51,7 @@ #include <postmac.h> class DropTarget; +class AquaSalFrame; /* The functions declared in this protocol are actually declared in vcl/aqua/inc/salframe.h. Because we want @@ -159,6 +160,7 @@ private: com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboard > mXCurrentDragClipboard; DataFlavorMapperPtr_t mDataFlavorMapper; id mView; + AquaSalFrame* mpFrame; DropTargetHelper* mDropTargetHelper; bool mbActive; sal_Int8 mDragSourceSupportedActions; diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index a1d51376aa0b..ed80110cacc6 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -834,12 +834,24 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData ) for( unsigned int i = 0; i < nPapers; i++ ) { NSString* pPaper = [pPaperNames objectAtIndex: i]; - NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; - if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + // first try to match the name + rtl::OString aPaperName( [pPaper UTF8String] ); + Paper ePaper = PaperInfo::fromPSName( aPaperName ); + if( ePaper != PAPER_USER ) { - PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), - PtTo10Mu( aPaperSize.height ) ); - m_aPaperFormats.push_back( aInfo ); + m_aPaperFormats.push_back( PaperInfo( ePaper ) ); + } + else + { + NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; + if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + { + PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), + PtTo10Mu( aPaperSize.height ) ); + if( aInfo.getPaper() == PAPER_USER ) + aInfo.doSloppyFit(); + m_aPaperFormats.push_back( aInfo ); + } } } } diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 783d203c76fd..ba8751307c70 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -398,6 +398,11 @@ static AquaSalFrame* getMouseContainerFrame() return self; } +-(AquaSalFrame*)getSalFrame +{ + return mpFrame; +} + -(void)resetCursorRects { if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx index 14fd58296b0d..c143e49002fa 100644 --- a/vcl/inc/vcl/cursor.hxx +++ b/vcl/inc/vcl/cursor.hxx @@ -64,15 +64,13 @@ private: sal_Bool mbVisible; // Ist Cursor sichtbar unsigned char mnDirection; // indicates direction -//#if 0 // _SOLAR__PRIVATE public: SAL_DLLPRIVATE void ImplDraw(); SAL_DLLPRIVATE void ImplRestore(); DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* ); - SAL_DLLPRIVATE void ImplShow( sal_Bool bDrawDirect = sal_True ); - SAL_DLLPRIVATE void ImplHide(); + SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true, bool bRestore = false ); + SAL_DLLPRIVATE bool ImplHide(); SAL_DLLPRIVATE void ImplNew(); -//#endif public: Cursor(); diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx index f1e203a84431..bf2a09c1dd42 100644 --- a/vcl/inc/vcl/pdfextoutdevdata.hxx +++ b/vcl/inc/vcl/pdfextoutdevdata.hxx @@ -52,8 +52,24 @@ namespace vcl */ struct PDFExtOutDevBookmarkEntry { + /** ID of the link pointing to the bookmark, or -1 if the entry denotes a destination instead of a link. + */ sal_Int32 nLinkId; + + /** ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a named destination. + */ + sal_Int32 nDestId; + + /** link target name, respectively destination name + */ rtl::OUString aBookmark; + + PDFExtOutDevBookmarkEntry() + :nLinkId( -1 ) + ,nDestId( -1 ) + ,aBookmark() + { + } }; /* @@ -195,6 +211,24 @@ public : -1 if page id does not exist */ sal_Int32 CreateNamedDest( const String& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + + /** registers a destination for which a destinatin ID needs to be known immediately, instead of later on setting it via + SetLinkDest. + + This is used in contexts where a destination is referenced by means other than a link. + + Later in the export process, a call to DescribeRegisteredDest must be made, providing the information about + the destination. + + @return + the unique Id of the destination + */ + sal_Int32 RegisterDest(); + + /** provides detailed information about a destination range which previously has been registered using RegisterDest. + */ + void DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + //<---i56629 /** Create a new destination to be used in a link diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx index 4e792ef40f57..09a8a08d5aca 100644 --- a/vcl/inc/vcl/pdfwriter.hxx +++ b/vcl/inc/vcl/pdfwriter.hxx @@ -939,6 +939,29 @@ The following structure describes the permissions used in PDF security -1 if page id does not exist */ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 ); + + /** creates a destination which is not intended to be referred to by a link, but by a public destination Id. + + Form widgets, for instance, might refer to a destination, without ever actually creating a source link to + point to this destination. In such cases, a public destination Id will be assigned to the form widget, + and later on, the concrete destination data for this public Id will be registered using RegisterDestReference. + + @param rRect + target rectangle on page to be displayed if dest is jumped to + + @param nPageNr + number of page the dest is on (as returned by NewPage) + or -1 in which case the current page is used + + @param eType + what dest type to use + + @returns + the internal destination Id. + */ + sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ ); + + /** Set the destination for a link <p>will change a URL type link to a dest link if necessary</p> diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index a50c8aeec149..6649f19e0030 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -346,8 +346,8 @@ static const sal_Char* pDbgHelpText[] = "Attempt to activate the debugger and produce the message there, in order to " "always obtain the corresponding stack trace in the debugger.\n", "\n", -"CoreDump\n", -"Causes a crash\n", +"Abort\n", +"Aborts the application\n", "\n", "\n", "Reroute osl messages - Checkbox\n", @@ -1083,7 +1083,7 @@ DbgDialog::DbgDialog() : maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maTraceBox ); ImplSelectChannel( maTraceBox, pData->nTraceOut, 0 ); maTraceBox.Show(); @@ -1106,7 +1106,7 @@ DbgDialog::DbgDialog() : maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maWarningBox ); ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 ); maWarningBox.Show(); @@ -1135,7 +1135,7 @@ DbgDialog::DbgDialog() : maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maErrorBox ); ImplSelectChannel( maErrorBox, pData->nErrorOut, mnErrorOff ); maErrorBox.Show(); @@ -1962,6 +1962,14 @@ void DbgPrintWindow( const char* pLine ) bIn = sal_False; } +// ----------------------------------------------------------------------- + +void DbgAbort( char const * i_message ) +{ + ::rtl::OUString const message( i_message, strlen( i_message ), osl_getThreadTextEncoding() ); + Application::Abort( message ); +} + // ======================================================================= void ImplDbgTestSolarMutex() @@ -1977,6 +1985,7 @@ void DbgGUIInit() DbgSetPrintMsgBox( DbgPrintMsgBox ); DbgSetPrintWindow( DbgPrintWindow ); DbgSetTestSolarMutex( ImplDbgTestSolarMutex ); + DbgSetAbort( DbgAbort ); } // ----------------------------------------------------------------------- @@ -1986,6 +1995,7 @@ void DbgGUIDeInit() DbgSetPrintMsgBox( NULL ); DbgSetPrintWindow( NULL ); DbgSetTestSolarMutex( NULL ); + DbgSetAbort( NULL ); DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin; if ( pDbgWindow ) diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index c075e1b108f3..115d0afbb24d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -370,7 +370,9 @@ void DeInitVCL() aBuf.append( rtl::OUStringToOString( pWin->GetText(), osl_getThreadTextEncoding() ) ); aBuf.append( "\" type = \"" ); aBuf.append( typeid(*pWin).name() ); - aBuf.append( "\"\n" ); + aBuf.append( "\", ptr = 0x" ); + aBuf.append( sal_Int64( pWin ), 16 ); + aBuf.append( "\n" ); } } DBG_ASSERT( nBadTopWindows==0, aBuf.getStr() ); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 670d6dad0ada..793d12a0e93e 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -2069,8 +2069,6 @@ void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop ) mnTop = nTop; Scroll( 0, nDiff ); Update(); - maFocusRect.Top() += nDiff; - maFocusRect.Bottom() += nDiff; if( HasFocus() ) ImplShowFocusRect(); maScrollHdl.Call( this ); diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index ff3c9a20ef06..8321e56443f3 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -299,13 +299,16 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup ) // Zur Zeit haben wir noch kein neues FileFormat // if ( rIStream.GetVersion() < JOBSET_FILEFORMAT2 ) { - sal_uInt16 nLen; - sal_uInt16 nSystem; sal_Size nFirstPos = rIStream.Tell(); + + sal_uInt16 nLen = 0; rIStream >> nLen; if ( !nLen ) return rIStream; + + sal_uInt16 nSystem = 0; rIStream >> nSystem; + char* pTempBuf = new char[nLen]; rIStream.Read( pTempBuf, nLen - sizeof( nLen ) - sizeof( nSystem ) ); if ( nLen >= sizeof(ImplOldJobSetupData)+4 ) diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 77458d2b26fd..c47b034e1011 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -31,22 +31,25 @@ #include "vcl/graph.hxx" #include "vcl/outdev.hxx" #include "vcl/gfxlink.hxx" +#include "vcl/dllapi.h" #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolygontools.hxx" #include <boost/shared_ptr.hpp> #include <set> +#include <map> namespace vcl { -struct PDFExtOutDevDataSync +struct SAL_DLLPRIVATE PDFExtOutDevDataSync { enum Action{ CreateNamedDest, CreateDest, CreateLink, SetLinkDest, SetLinkURL, + RegisterDest, CreateOutlineItem, SetOutlineItemParent, SetOutlineItemText, @@ -73,7 +76,15 @@ struct PDFExtOutDevDataSync Action eAct; }; -struct GlobalSyncData +struct SAL_DLLPRIVATE PDFLinkDestination +{ + Rectangle mRect; + MapMode mMapMode; + sal_Int32 mPageNr; + PDFWriter::DestAreaType mAreaType; +}; + +struct SAL_DLLPRIVATE GlobalSyncData { std::deque< PDFExtOutDevDataSync::Action > mActions; std::deque< MapMode > mParaMapModes; @@ -84,6 +95,7 @@ struct GlobalSyncData std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes; std::deque< PDFNote > mParaPDFNotes; std::deque< PDFWriter::PageTransition > mParaPageTransitions; + ::std::map< sal_Int32, PDFLinkDestination > mFutureDestinations; sal_Int32 GetMappedId(); sal_Int32 GetMappedStructId( sal_Int32 ); @@ -145,7 +157,7 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter ) { switch( *aIter ) { - case PDFExtOutDevDataSync::CreateNamedDest : //i56629 + case PDFExtOutDevDataSync::CreateNamedDest : //i56629 { rWriter.Push( PUSH_MAPMODE ); rWriter.SetMapMode( mParaMapModes.front() ); @@ -197,6 +209,21 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter ) mParaOUStrings.pop_front(); } break; + case PDFExtOutDevDataSync::RegisterDest : + { + const sal_Int32 nDestId = mParaInts.front(); + mParaInts.pop_front(); + OSL_ENSURE( mFutureDestinations.find( nDestId ) != mFutureDestinations.end(), + "GlobalSyncData::PlayGlobalActions: DescribeRegisteredRequest has not been called for that destination!" ); + + PDFLinkDestination& rDest = mFutureDestinations[ nDestId ]; + + rWriter.Push( PUSH_MAPMODE ); + rWriter.SetMapMode( rDest.mMapMode ); + mParaIds.push_back( rWriter.RegisterDestReference( nDestId, rDest.mRect, rDest.mPageNr, rDest.mAreaType ) ); + rWriter.Pop(); + } + break; case PDFExtOutDevDataSync::CreateOutlineItem : { sal_Int32 nParent = GetMappedId(); @@ -459,6 +486,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM case PDFExtOutDevDataSync::CreateLink: case PDFExtOutDevDataSync::SetLinkDest: case PDFExtOutDevDataSync::SetLinkURL: + case PDFExtOutDevDataSync::RegisterDest: case PDFExtOutDevDataSync::CreateOutlineItem: case PDFExtOutDevDataSync::SetOutlineItemParent: case PDFExtOutDevDataSync::SetOutlineItemText: @@ -617,9 +645,28 @@ sal_Int32 PDFExtOutDevData::CreateNamedDest(const String& sDestName, const Rect mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() ); mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr ); mpGlobalSyncData->mParaDestAreaTypes.push_back( eType ); + return mpGlobalSyncData->mCurId++; } //<---i56629 +sal_Int32 PDFExtOutDevData::RegisterDest() +{ + const sal_Int32 nLinkDestID = mpGlobalSyncData->mCurId++; + mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::RegisterDest ); + mpGlobalSyncData->mParaInts.push_back( nLinkDestID ); + + return nLinkDestID; +} +void PDFExtOutDevData::DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) +{ + OSL_PRECOND( nDestId != -1, "PDFExtOutDevData::DescribeRegisteredDest: invalid destination Id!" ); + PDFLinkDestination aLinkDestination; + aLinkDestination.mRect = rRect; + aLinkDestination.mMapMode = mrOutDev.GetMapMode(); + aLinkDestination.mPageNr = nPageNr == -1 ? mnPage : nPageNr; + aLinkDestination.mAreaType = eType; + mpGlobalSyncData->mFutureDestinations[ nDestId ] = aLinkDestination; +} sal_Int32 PDFExtOutDevData::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) { mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateDest ); diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index 445365e83dd4..d6c5aed6b52a 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -420,6 +420,10 @@ sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr ) { return ((PDFWriterImpl*)pImplementation)->createLink( rRect, nPageNr ); } +sal_Int32 PDFWriter::RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType ) +{ + return ((PDFWriterImpl*)pImplementation)->registerDestReference( nDestId, rRect, nPageNr, eType ); +} //--->i56629 sal_Int32 PDFWriter::CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 4a37d3a5d601..f8a2bbc051a0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5613,7 +5613,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() if(!m_bIsPDF_A1) { OStringBuffer aDest; - if( rWidget.m_nDest != -1 && appendDest( rWidget.m_nDest, aDest ) ) + if( rWidget.m_nDest != -1 && appendDest( m_aDestinationIdTranslation[ rWidget.m_nDest ], aDest ) ) { aLine.append( "/AA<</D<</Type/Action/S/GoTo/D " ); aLine.append( aDest.makeStringAndClear() ); @@ -10839,6 +10839,11 @@ sal_Int32 PDFWriterImpl::createDest( const Rectangle& rRect, sal_Int32 nPageNr, return nRet; } +sal_Int32 PDFWriterImpl::registerDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) +{ + return m_aDestinationIdTranslation[ nDestId ] = createDest( rRect, nPageNr, eType ); +} + sal_Int32 PDFWriterImpl::setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId ) { if( nLinkId < 0 || nLinkId >= (sal_Int32)m_aLinks.size() ) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index c73be7c037e5..5cfe1be8d0f1 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -613,6 +613,9 @@ private: dest id is always the dest's position in this vector */ std::vector<PDFDest> m_aDests; + /** contains destinations accessible via a public Id, instead of being linked to by an ordinary link + */ + ::std::map< sal_Int32, sal_Int32 > m_aDestinationIdTranslation; /* contains all links ever set during PDF creation, link id is always the link's position in this vector */ @@ -1279,6 +1282,7 @@ public: // links sal_Int32 createLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 ); sal_Int32 createDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + sal_Int32 registerDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); sal_Int32 setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId ); sal_Int32 setLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL ); void setLinkPropertyId( sal_Int32 nLinkId, sal_Int32 nPropertyId ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 34276fafdfe5..3873cdc6cb14 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -333,26 +333,13 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr // setup printer - // if no specific printer is already set, create one - - // #i108686# - // in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs - // however if no printer was already set by the print job's originator, - // and this is an API job, then use the system default location (because - // this is the only sensible default available if the user has no means of changing - // the destination + // #i114306# changed behavior back from persistence + // if no specific printer is already set, create the default printer if( ! pController->getPrinter() ) { rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() ); - if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() ) - { - // get printer name from configuration - SettingsConfigItem* pItem = SettingsConfigItem::get(); - aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) ); - } - boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) ); + pPrinter->SetJobSetup( i_rInitSetup ); pController->setPrinter( pPrinter ); } @@ -399,17 +386,25 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr { if( nContent == 0 ) { - sal_Int32 nPages = i_pController->getPageCount(); - if( nPages > 0 ) + // do not overwrite PageRange if it is already set + beans::PropertyValue* pRangeVal = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) ); + rtl::OUString aRange; + if( pRangeVal ) + pRangeVal->Value >>= aRange; + if( aRange.getLength() == 0 ) { - rtl::OUStringBuffer aBuf( 32 ); - aBuf.appendAscii( "1" ); - if( nPages > 1 ) + sal_Int32 nPages = i_pController->getPageCount(); + if( nPages > 0 ) { - aBuf.appendAscii( "-" ); - aBuf.append( nPages ); + rtl::OUStringBuffer aBuf( 32 ); + aBuf.appendAscii( "1" ); + if( nPages > 1 ) + { + aBuf.appendAscii( "-" ); + aBuf.append( nPages ); + } + i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) ); } - i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) ); } } } diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 3be6fad02366..c59978077412 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -171,7 +171,7 @@ void Cursor::ImplRestore() // ----------------------------------------------------------------------- -void Cursor::ImplShow( sal_Bool bDrawDirect ) +void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) { if ( mbVisible ) { @@ -199,10 +199,10 @@ void Cursor::ImplShow( sal_Bool bDrawDirect ) mpData->mpWindow = pWindow; mpData->mnStyle = mnStyle; - if ( bDrawDirect ) + if ( bDrawDirect || bRestore ) ImplDraw(); - if ( !mpWindow ) + if ( !mpWindow && ! ( ! bDrawDirect && mpData->maTimer.IsActive()) ) { mpData->maTimer.SetTimeout( pWindow->GetSettings().GetStyleSettings().GetCursorBlinkTime() ); if ( mpData->maTimer.GetTimeout() != STYLE_CURSOR_NOBLINKTIME ) @@ -216,16 +216,16 @@ void Cursor::ImplShow( sal_Bool bDrawDirect ) // ----------------------------------------------------------------------- -void Cursor::ImplHide() +bool Cursor::ImplHide() { + bool bWasCurVisible = false; if ( mpData && mpData->mpWindow ) { + bWasCurVisible = mpData->mbCurVisible; if ( mpData->mbCurVisible ) ImplRestore(); - - mpData->maTimer.Stop(); - mpData->mpWindow = NULL; } + return bWasCurVisible; } // ----------------------------------------------------------------------- @@ -329,6 +329,12 @@ void Cursor::Hide() { mbVisible = sal_False; ImplHide(); + + if( mpData ) + { + mpData->maTimer.Stop(); + mpData->mpWindow = NULL; + } } } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 5569759a3fff..d38128e04f1e 100644..100755 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1061,6 +1061,13 @@ void PrintDialog::readFromSettings() } } maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + + // persistent window state + rtl::OUString aWinState( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ) ) ); + if( aWinState.getLength() ) + SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) ); + if( maOptionsPage.maToFileBox.IsChecked() ) { maPController->resetPrinterOptions( true ); @@ -1083,6 +1090,10 @@ void PrintDialog::storeToSettings() pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ), maTabCtrl.GetPageText( maTabCtrl.GetCurPageId() ) ); + pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ), + rtl::OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 ) + ); pItem->Commit(); } @@ -2096,6 +2107,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); + preparePreview( true, false ); } else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 6ddb10c92cd7..96e787928772 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2405,8 +2405,9 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) mpWindowImpl->mnPaintFlags = 0; if ( !mpWindowImpl->maInvalidateRegion.IsEmpty() ) { + bool bRestoreCursor = false; if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplHide(); + bRestoreCursor = mpWindowImpl->mpCursor->ImplHide(); mbInitClipRegion = sal_True; mpWindowImpl->mbInPaint = sal_True; @@ -2453,7 +2454,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) mbInitClipRegion = sal_True; mpWindowImpl->mpPaintRegion = NULL; if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( sal_False ); + mpWindowImpl->mpCursor->ImplShow( false, bRestoreCursor ); } } else @@ -3042,7 +3043,7 @@ void Window::ImplScroll( const Rectangle& rRect, Update(); if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( sal_False ); + mpWindowImpl->mpCursor->ImplShow( false ); } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 9cb38756e770..795bea17a3b9 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1646,7 +1646,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight ) // #i42750# presentation wants to be informed about resize // as early as possible WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow->ImplGetWindowImpl()->mpClientWindow); - if( pWorkWindow && pWorkWindow->IsPresentationMode() ) + if( ! pWorkWindow || pWorkWindow->IsPresentationMode() ) + bStartTimer = false; + } + else + { + WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow); + if( ! pWorkWindow || pWorkWindow->IsPresentationMode() ) bStartTimer = false; } } diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 42d1f820acff..3333dc3faef4 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -127,7 +127,7 @@ enum SalRGB { RGB, RBG, RGBA, RBGA, GBRA, GRBA, BGRA, BRGA, - other }; + otherSalRGB }; // -=-= SalVisual =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= class SalVisual : public XVisualInfo diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx index 99871edadae3..dcf1db32068e 100644 --- a/vcl/unx/kde4/KDEData.cxx +++ b/vcl/unx/kde4/KDEData.cxx @@ -51,4 +51,4 @@ void KDEData::initNWF() void KDEData::deInitNWF() { -}
\ No newline at end of file +} diff --git a/vcl/unx/kde4/KDEData.hxx b/vcl/unx/kde4/KDEData.hxx index 7cf5836c9688..6daa0c81a4fb 100644 --- a/vcl/unx/kde4/KDEData.hxx +++ b/vcl/unx/kde4/KDEData.hxx @@ -39,4 +39,4 @@ class KDEData : public X11SalData virtual void Init(); virtual void initNWF(); virtual void deInitNWF(); -};
\ No newline at end of file +}; diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx index d67399528a7c..41fa9fedde3f 100644 --- a/vcl/unx/kde4/KDESalDisplay.cxx +++ b/vcl/unx/kde4/KDESalDisplay.cxx @@ -42,4 +42,4 @@ SalKDEDisplay::~SalKDEDisplay() doDestruct(); // prevent SalDisplay from closing KApplication's display pDisp_ = NULL; -}
\ No newline at end of file +} diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index 0c8f04f9fe41..abd1dc993f9e 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -56,12 +56,12 @@ #include <stdio.h> #endif -KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) : +KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nState ) : X11SalFrame( pParent, nState ) { } -void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) ) { @@ -86,12 +86,14 @@ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey ) return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() ); } +#if 0 /** Helper function to read color from KConfig configuration repository. */ static Color readColor( KConfigGroup *pGroup, const char *pKey ) { return toColor( pGroup->readEntry( pKey, QColor(Qt::white) ) ); } +#endif /** Helper function to add information to Font from QFont. @@ -179,7 +181,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r void KDESalFrame::UpdateSettings( AllSettings& rSettings ) { StyleSettings style( rSettings.GetStyleSettings() ); - BOOL bSetTitleFont = false; + bool bSetTitleFont = false; // General settings QPalette pal = kapp->palette(); @@ -272,9 +274,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) { Color aColor2 = style.GetLightColor(); style. - SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2), - (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2), - (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2) + SetCheckedColor( Color( (sal_uInt8)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2), + (sal_uInt8)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2), + (sal_uInt8)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2) ) ); } @@ -402,4 +404,4 @@ SalGraphics* KDESalFrame::GetGraphics() } return NULL; -}
\ No newline at end of file +} diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx index 643be72c27f3..6ea6f6ef283e 100644 --- a/vcl/unx/kde4/KDESalFrame.hxx +++ b/vcl/unx/kde4/KDESalFrame.hxx @@ -47,12 +47,12 @@ class KDESalFrame : public X11SalFrame GraphicsHolder m_aGraphics[ nMaxGraphics ]; public: - KDESalFrame( SalFrame* pParent, ULONG nStyle ); + KDESalFrame( SalFrame* pParent, sal_uLong nStyle ); virtual ~KDESalFrame(); virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics *pGraphics ); virtual void updateGraphics( bool bClear ); virtual void UpdateSettings( AllSettings& rSettings ); - virtual void Show( BOOL bVisible, BOOL bNoActivate ); -};
\ No newline at end of file + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate ); +}; diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 5a5cd11c52d9..9b37bf5e8e2a 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -100,7 +100,7 @@ KDESalGraphics::~KDESalGraphics() delete m_image; } -BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part ) +sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part ) { if (type == CTRL_PUSHBUTTON) return true; @@ -154,9 +154,9 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par return false; } -BOOL KDESalGraphics::hitTestNativeControl( ControlType, ControlPart, +sal_Bool KDESalGraphics::hitTestNativeControl( ControlType, ControlPart, const Rectangle&, const Point&, - BOOL& ) + sal_Bool& ) { return FALSE; } @@ -232,7 +232,7 @@ namespace } } -BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, +sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, const Rectangle& rControlRegion, ControlState nControlState, const ImplControlValue& value, const OUString& ) @@ -243,7 +243,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, return false; } - BOOL returnVal = true; + sal_Bool returnVal = true; QRect widgetRect = region2QRect(rControlRegion); if( type == CTRL_SPINBOX && part == PART_ALL_BUTTONS ) @@ -562,8 +562,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, { if( pTempClipRegion ) { - if( pClipRegion_ ) - XIntersectRegion( pTempClipRegion, pClipRegion_, pTempClipRegion ); + if( mpClipRegion ) + XIntersectRegion( pTempClipRegion, mpClipRegion, pTempClipRegion ); XSetRegion( GetXDisplay(), gc, pTempClipRegion ); } QPixmap pixmap = QPixmap::fromImage(*m_image, Qt::ColorOnly | Qt::OrderedDither | Qt::OrderedAlphaDither); @@ -574,8 +574,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if( pTempClipRegion ) { - if( pClipRegion_ ) - XSetRegion( GetXDisplay(), gc, pClipRegion_ ); + if( mpClipRegion ) + XSetRegion( GetXDisplay(), gc, mpClipRegion ); else XSetClipMask( GetXDisplay(), gc, None ); } @@ -589,7 +589,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, return returnVal; } -BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, +sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, const Rectangle& controlRegion, ControlState controlState, const ImplControlValue& val, const OUString&, @@ -769,7 +769,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, if( part == PART_BORDER ) { int nFrameWidth = getFrameWidth(); - USHORT nStyle = val.getNumericVal(); + sal_uInt16 nStyle = val.getNumericVal(); if( nStyle & FRAME_DRAW_NODRAW ) { // in this case the question is: how thick would a frame be diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx index 0bce1700f1fc..92b9a6b676a0 100644 --- a/vcl/unx/kde4/KDESalGraphics.hxx +++ b/vcl/unx/kde4/KDESalGraphics.hxx @@ -50,16 +50,16 @@ class KDESalGraphics : public X11SalGraphics @param part Specification of the widget's part if it consists of more than one. @return true if the platform supports native drawing of the widget type defined by part. */ - virtual BOOL IsNativeControlSupported( ControlType type, ControlPart part ); + virtual sal_Bool IsNativeControlSupported( ControlType type, ControlPart part ); /** Test whether the position is in the native widget. If the return value is TRUE, bIsInside contains information whether aPos was or was not inside the native widget specified by the type/part combination. */ - virtual BOOL hitTestNativeControl( ControlType type, ControlPart part, + virtual sal_Bool hitTestNativeControl( ControlType type, ControlPart part, const Rectangle& rControlRegion, const Point& aPos, - BOOL& rIsInside ); + sal_Bool& rIsInside ); /** Draw the requested control described by part/nControlState. @param rControlRegion @@ -71,7 +71,7 @@ class KDESalGraphics : public X11SalGraphics @param aCaption A caption or title string (like button text etc.) */ - virtual BOOL drawNativeControl( ControlType type, ControlPart part, + virtual sal_Bool drawNativeControl( ControlType type, ControlPart part, const Rectangle& rControlRegion, ControlState nControlState, const ImplControlValue& aValue, const rtl::OUString& aCaption ); @@ -84,7 +84,7 @@ class KDESalGraphics : public X11SalGraphics @param aValue An optional value (tristate/numerical/string) @param aCaption A caption or title string (like button text etc.) */ - virtual BOOL drawNativeControlText( ControlType, ControlPart, + virtual sal_Bool drawNativeControlText( ControlType, ControlPart, const Rectangle&, ControlState, const ImplControlValue&, const rtl::OUString& ) { return false; } @@ -105,9 +105,9 @@ class KDESalGraphics : public X11SalGraphics @param aCaption A caption or title string (like button text etc.) */ - virtual BOOL getNativeControlRegion( ControlType type, ControlPart part, + virtual sal_Bool getNativeControlRegion( ControlType type, ControlPart part, const Rectangle& rControlRegion, ControlState nControlState, const ImplControlValue& aValue, const rtl::OUString& aCaption, Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); -};
\ No newline at end of file +}; diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx index 01c4723bd530..c8d0858279f3 100644 --- a/vcl/unx/kde4/KDESalInstance.cxx +++ b/vcl/unx/kde4/KDESalInstance.cxx @@ -29,7 +29,7 @@ #include "KDESalFrame.hxx" -SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState ) +SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState ) { return new KDESalFrame( pParent, nState ); -}
\ No newline at end of file +} diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx index 7d050fe6819e..91907e586b0c 100644 --- a/vcl/unx/kde4/KDESalInstance.hxx +++ b/vcl/unx/kde4/KDESalInstance.hxx @@ -37,5 +37,5 @@ class KDESalInstance : public X11SalInstance public: KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {} virtual ~KDESalInstance() {} - virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ); -};
\ No newline at end of file + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); +}; diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 6a2793b8abe3..3fb2bcaf487d 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -102,7 +102,7 @@ void KDEXLib::Init() //kAboutData->setProgramIconName("OpenOffice"); m_nFakeCmdLineArgs = 1; - USHORT nIdx; + int nIdx; vos::OExtCommandLine aCommandLine; int nParams = aCommandLine.getCommandArgCount(); rtl::OString aDisplay; diff --git a/vcl/unx/kde4/VCLKDEApplication.cxx b/vcl/unx/kde4/VCLKDEApplication.cxx index 2cfb071e96ae..5e3a85256313 100644 --- a/vcl/unx/kde4/VCLKDEApplication.cxx +++ b/vcl/unx/kde4/VCLKDEApplication.cxx @@ -49,4 +49,4 @@ bool VCLKDEApplication::x11EventFilter(XEvent* event) } return false; -}
\ No newline at end of file +} diff --git a/vcl/unx/kde4/VCLKDEApplication.hxx b/vcl/unx/kde4/VCLKDEApplication.hxx index 2edfddd69a9c..7cbbe38b61df 100644 --- a/vcl/unx/kde4/VCLKDEApplication.hxx +++ b/vcl/unx/kde4/VCLKDEApplication.hxx @@ -50,4 +50,4 @@ class VCLKDEApplication : public KApplication virtual bool x11EventFilter(XEvent* event); SalKDEDisplay* disp; -};
\ No newline at end of file +}; diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 91f6934f27f0..39d2803720c8 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -912,7 +912,7 @@ void SalDisplay::Init() // carefully. if we are running linux (i.e. not netbsd) on an xfree // display, fvwm is most probable the wm to choose, confusing with mwm // doesn't harm. #57791# start maximized if possible - if( (otherwm == eWindowManager_) + if( (otherwm == eWindowManager_) || (olwm == eWindowManager_ )) { eWindowManager_ = fvwm; // ??? @@ -2790,44 +2790,44 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) if( blue_mask == 0xFF ) eRGBMode_ = RGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = RBG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( blue_mask == 0xFF ) eRGBMode_ = GRB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = GBR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = BRG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = BGR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; } } @@ -2851,7 +2851,7 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) switch( GetMode() ) { - case other: + case otherSalRGB: return sal_False; case SALCOLOR: break; @@ -2886,7 +2886,7 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 ) switch( GetMode() ) { - case other: + case otherSalRGB: return sal_False; case SALCOLOR: break; @@ -2939,7 +2939,7 @@ SalColor SalVisual::GetTCColor( Pixel nPixel ) const Pixel g = nPixel & green_mask; Pixel b = nPixel & blue_mask; - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return MAKE_SALCOLOR( r >> nRedShift_, g >> nGreenShift_, b >> nBlueShift_ ); @@ -2970,7 +2970,7 @@ Pixel SalVisual::GetTCPixel( SalColor nSalColor ) const if( SALCOLORREVERSE == eRGBMode_ ) return (b << 16) | (g << 8) | (r); - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_); if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index dc1ec968d859..df23220ea6d5 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1217,6 +1217,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double aPolygon.transform( basegfx::tools::createTranslateB2DHomMatrix(+fHalfWidth,+fHalfWidth) ); // shortcut for hairline drawing to improve performance + bool bDrawnOk = true; if( bIsHairline ) { // hairlines can benefit from a simplified tesselation @@ -1225,17 +1226,13 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); // draw tesselation result - if( ! aB2DTrapVector.empty() ) - { - const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + const int nTrapCount = aB2DTrapVector.size(); + if( nTrapCount > 0 ) + bDrawnOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); - // restore the original brush GC - nBrushColor_ = aKeepBrushColor; - return bDrawOk; - } - else - return true; + // restore the original brush GC + nBrushColor_ = aKeepBrushColor; + return bDrawnOk; } // get the area polygon for the line polygon @@ -1258,19 +1255,18 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double // draw each area polypolygon component individually // to emulate the polypolygon winding rule "non-zero" - bool bDrawOk = true; const int nPolyCount = aAreaPolyPoly.count(); for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) ); - bDrawOk = drawPolyPolygon( aOnePoly, fTransparency ); - if( !bDrawOk ) + bDrawnOk = drawPolyPolygon( aOnePoly, fTransparency ); + if( !bDrawnOk ) break; } // restore the original brush GC nBrushColor_ = aKeepBrushColor; - return bDrawOk; + return bDrawnOk; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 62bdb4403c1f..73d93d42dd03 100755 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -541,7 +541,9 @@ void ImplSalInitGraphics( WinSalGraphics* pData ) void ImplSalDeInitGraphics( WinSalGraphics* pData ) { - // Default Objekte selektieren + // clear clip region + SelectClipRgn( pData->mhDC, 0 ); + // select default objects if ( pData->mhDefPen ) SelectPen( pData->mhDC, pData->mhDefPen ); if ( pData->mhDefBrush ) |