diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:33 +0100 |
commit | 932fb7b958f8e7204275cb709965b30e390c76ad (patch) | |
tree | 75f695663a97693416f8a84e140fa61805cf5bd2 /vcl/aqua/source | |
parent | bb54b94e5f48c4f6dce72f59dc6bc83f17d2c590 (diff) | |
parent | 78f80b020fe009bc48e9e5f8b7862de51f1f8381 (diff) |
Merge commit 'ooo/DEV300_m103'
Conflicts:
cppcanvas/source/mtfrenderer/implrenderer.cxx
dtrans/source/win32/dtobj/XTDataObject.cxx
dtrans/source/win32/dtobj/XTDataObject.hxx
sot/source/sdstor/stgio.cxx
tools/source/debug/debug.cxx
vcl/source/gdi/jobset.cxx
vcl/unx/kde4/KDEData.cxx
vcl/unx/kde4/KDEData.hxx
vcl/unx/kde4/KDESalDisplay.cxx
vcl/unx/kde4/KDESalFrame.cxx
vcl/unx/kde4/KDESalFrame.hxx
vcl/unx/kde4/KDESalGraphics.cxx
vcl/unx/kde4/KDESalGraphics.hxx
vcl/unx/kde4/KDESalInstance.cxx
vcl/unx/kde4/KDESalInstance.hxx
vcl/unx/kde4/KDEXLib.cxx
vcl/unx/kde4/VCLKDEApplication.cxx
vcl/unx/kde4/VCLKDEApplication.hxx
Diffstat (limited to 'vcl/aqua/source')
-rw-r--r-- | vcl/aqua/source/dtrans/DropTarget.cxx | 43 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/DropTarget.hxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 22 | ||||
-rwxr-xr-x | vcl/aqua/source/window/salframeview.mm | 5 |
4 files changed, 49 insertions, 23 deletions
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx index 1fb6b9bb2d53..e0318b405163 100644 --- a/vcl/aqua/source/dtrans/DropTarget.cxx +++ b/vcl/aqua/source/dtrans/DropTarget.cxx @@ -49,6 +49,8 @@ #include <Carbon/Carbon.h> #include <postmac.h> +#include <salframe.h> +#include <salframeview.h> using namespace cppu; using namespace osl; @@ -58,6 +60,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; using ::rtl::OUString; @@ -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 293db4d4eb39..2ec1674a13df 100644 --- a/vcl/aqua/source/dtrans/DropTarget.hxx +++ b/vcl/aqua/source/dtrans/DropTarget.hxx @@ -50,6 +50,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 @@ -158,6 +159,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 3e25d9eb111d..18377308c91d 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -832,12 +832,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 a72810986c76..57d605bed1ce 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -399,6 +399,11 @@ static AquaSalFrame* getMouseContainerFrame() return self; } +-(AquaSalFrame*)getSalFrame +{ + return mpFrame; +} + -(void)resetCursorRects { if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) |