This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new ea466eed2d Cleanup, fixed typos
ea466eed2d is described below
commit ea466eed2d689e648be51acebc1d7041c643cc2f
Author: mseidel <[email protected]>
AuthorDate: Thu Dec 18 16:03:29 2025 +0100
Cleanup, fixed typos
(cherry picked from commit 0c4cad538f83b30756fa17f65fffdbec2517f7fc)
---
main/vcl/unx/generic/dtrans/X11_clipboard.cxx | 82 ++--
main/vcl/unx/generic/dtrans/X11_dndcontext.cxx | 6 +-
main/vcl/unx/generic/dtrans/X11_dndcontext.hxx | 28 +-
main/vcl/unx/generic/dtrans/X11_droptarget.cxx | 20 +-
main/vcl/unx/generic/dtrans/X11_selection.cxx | 502 +++++++++++------------
main/vcl/unx/generic/dtrans/X11_service.cxx | 38 +-
main/vcl/unx/generic/dtrans/X11_transferable.cxx | 10 +-
main/vcl/unx/generic/dtrans/X11_transferable.hxx | 6 +-
8 files changed, 346 insertions(+), 346 deletions(-)
diff --git a/main/vcl/unx/generic/dtrans/X11_clipboard.cxx
b/main/vcl/unx/generic/dtrans/X11_clipboard.cxx
index e1332c1f98..36fe81f0bf 100644
--- a/main/vcl/unx/generic/dtrans/X11_clipboard.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_clipboard.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -52,12 +50,12 @@ using namespace rtl;
using namespace x11;
X11Clipboard::X11Clipboard( SelectionManager& rManager, Atom aSelection ) :
- ::cppu::WeakComponentImplHelper4<
- ::com::sun::star::datatransfer::clipboard::XClipboardEx,
- ::com::sun::star::datatransfer::clipboard::XClipboardNotifier,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::lang::XInitialization
- >( rManager.getMutex() ),
+ ::cppu::WeakComponentImplHelper4<
+ ::com::sun::star::datatransfer::clipboard::XClipboardEx,
+ ::com::sun::star::datatransfer::clipboard::XClipboardNotifier,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization
+ >( rManager.getMutex() ),
m_rSelectionManager( rManager ),
m_xSelectionManager( & rManager ),
@@ -68,9 +66,9 @@ X11Clipboard::X11Clipboard( SelectionManager& rManager, Atom
aSelection ) :
#endif
if( m_aSelection != None )
- {
+ {
m_rSelectionManager.registerHandler( m_aSelection, *this );
- }
+ }
else
{
m_rSelectionManager.registerHandler( XA_PRIMARY, *this );
@@ -85,7 +83,7 @@ X11Clipboard::~X11Clipboard()
MutexGuard aGuard( *Mutex::getGlobalMutex() );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "shutting down instance of X11Clipboard (this=%p,
Selecttion=\"%s\")\n", this, OUStringToOString( m_rSelectionManager.getString(
m_aSelection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
+ fprintf( stderr, "shutting down instance of X11Clipboard (this=%p,
Selection=\"%s\")\n", this, OUStringToOString( m_rSelectionManager.getString(
m_aSelection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
#endif
if( m_aSelection != None )
m_rSelectionManager.deregisterHandler( m_aSelection );
@@ -101,21 +99,21 @@ X11Clipboard::~X11Clipboard()
void X11Clipboard::fireChangedContentsEvent()
{
- ClearableMutexGuard aGuard( m_rSelectionManager.getMutex() );
+ ClearableMutexGuard aGuard( m_rSelectionManager.getMutex() );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "X11Clipboard::fireChangedContentsEvent for %s (%d
listeners)\n",
- OUStringToOString( m_rSelectionManager.getString( m_aSelection ),
RTL_TEXTENCODING_ISO_8859_1 ).getStr(), m_aListeners.size() );
+ fprintf( stderr, "X11Clipboard::fireChangedContentsEvent for %s (%d
listeners)\n",
+ OUStringToOString( m_rSelectionManager.getString(
m_aSelection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(), m_aListeners.size() );
#endif
- ::std::list< Reference< XClipboardListener > > listeners( m_aListeners );
- aGuard.clear();
-
- ClipboardEvent aEvent( static_cast<OWeakObject*>(this), m_aContents);
- while( listeners.begin() != listeners.end() )
- {
- if( listeners.front().is() )
- listeners.front()->changedContents(aEvent);
- listeners.pop_front();
- }
+ ::std::list< Reference< XClipboardListener > > listeners( m_aListeners
);
+ aGuard.clear();
+
+ ClipboardEvent aEvent( static_cast<OWeakObject*>(this), m_aContents);
+ while( listeners.begin() != listeners.end() )
+ {
+ if( listeners.front().is() )
+ listeners.front()->changedContents(aEvent);
+ listeners.pop_front();
+ }
}
// ------------------------------------------------------------------------
@@ -123,20 +121,20 @@ void X11Clipboard::fireChangedContentsEvent()
void X11Clipboard::clearContents()
{
ClearableMutexGuard aGuard(m_rSelectionManager.getMutex());
- // protect against deletion during outside call
- Reference< XClipboard > xThis( static_cast<XClipboard*>(this));
- // copy member references on stack so they can be called
- // without having the mutex
- Reference< XClipboardOwner > xOwner( m_aOwner );
- Reference< XTransferable > xTrans( m_aContents );
+ // protect against deletion during outside call
+ Reference< XClipboard > xThis( static_cast<XClipboard*>(this));
+ // copy member references on stack so they can be called
+ // without having the mutex
+ Reference< XClipboardOwner > xOwner( m_aOwner );
+ Reference< XTransferable > xTrans( m_aContents );
// clear members
- m_aOwner.clear();
- m_aContents.clear();
+ m_aOwner.clear();
+ m_aContents.clear();
- // release the mutex
- aGuard.clear();
+ // release the mutex
+ aGuard.clear();
- // inform previous owner of lost ownership
+ // inform previous owner of lost ownership
if ( xOwner.is() )
xOwner->lostOwnership(xThis, m_aContents);
}
@@ -209,8 +207,8 @@ sal_Int8 SAL_CALL X11Clipboard::getRenderingCapabilities()
void SAL_CALL X11Clipboard::addClipboardListener( const Reference<
XClipboardListener >& listener )
throw(RuntimeException)
{
- MutexGuard aGuard( m_rSelectionManager.getMutex() );
- m_aListeners.push_back( listener );
+ MutexGuard aGuard( m_rSelectionManager.getMutex() );
+ m_aListeners.push_back( listener );
}
// ------------------------------------------------------------------------
@@ -218,8 +216,8 @@ void SAL_CALL X11Clipboard::addClipboardListener( const
Reference< XClipboardLis
void SAL_CALL X11Clipboard::removeClipboardListener( const Reference<
XClipboardListener >& listener )
throw(RuntimeException)
{
- MutexGuard aGuard( m_rSelectionManager.getMutex() );
- m_aListeners.remove( listener );
+ MutexGuard aGuard( m_rSelectionManager.getMutex() );
+ m_aListeners.remove( listener );
}
@@ -241,14 +239,14 @@ void X11Clipboard::clearTransferable()
void X11Clipboard::fireContentsChanged()
{
- fireChangedContentsEvent();
+ fireChangedContentsEvent();
}
// ------------------------------------------------------------------------
Reference< XInterface > X11Clipboard::getReference() throw()
{
- return Reference< XInterface >( static_cast< OWeakObject* >(this) );
+ return Reference< XInterface >( static_cast< OWeakObject* >(this) );
}
// ------------------------------------------------------------------------
@@ -286,3 +284,5 @@ Sequence< OUString > SAL_CALL
X11Clipboard::getSupportedServiceNames( )
{
return X11Clipboard_getSupportedServiceNames();
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_dndcontext.cxx
b/main/vcl/unx/generic/dtrans/X11_dndcontext.cxx
index 1009a0d16d..f91d04bd1f 100644
--- a/main/vcl/unx/generic/dtrans/X11_dndcontext.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_dndcontext.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -71,7 +69,7 @@ void DropTargetDropContext::dropComplete( sal_Bool success )
throw()
DropTargetDragContext::DropTargetDragContext(
XLIB_Window aDropWindow,
- XLIB_Time aTimestamp,
+ XLIB_Time aTimestamp,
SelectionManager& rManager ) :
m_aDropWindow( aDropWindow ),
m_nTimestamp( aTimestamp ),
@@ -132,3 +130,5 @@ void DragSourceContext::transferablesFlavorsChanged()
throw()
{
m_rManager.transferablesFlavorsChanged();
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_dndcontext.hxx
b/main/vcl/unx/generic/dtrans/X11_dndcontext.hxx
index d0c8f315bc..4b7f71e23e 100644
--- a/main/vcl/unx/generic/dtrans/X11_dndcontext.hxx
+++ b/main/vcl/unx/generic/dtrans/X11_dndcontext.hxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef _DTRANS_X11_DNDCONTEXT_HXX
#define _DTRANS_X11_DNDCONTEXT_HXX
@@ -44,10 +42,10 @@ namespace x11 {
::com::sun::star::datatransfer::dnd::XDropTargetDropContext
>
{
- XLIB_Window m_aDropWindow;
- XLIB_Time m_nTimestamp;
- SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ XLIB_Window m_aDropWindow;
+ XLIB_Time m_nTimestamp;
+ SelectionManager& m_rManager;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDropContext( XLIB_Window, XLIB_Time,
SelectionManager& );
virtual ~DropTargetDropContext();
@@ -63,10 +61,10 @@ namespace x11 {
::com::sun::star::datatransfer::dnd::XDropTargetDragContext
>
{
- XLIB_Window m_aDropWindow;
- XLIB_Time m_nTimestamp;
- SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ XLIB_Window m_aDropWindow;
+ XLIB_Time m_nTimestamp;
+ SelectionManager& m_rManager;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDragContext( XLIB_Window, XLIB_Time,
SelectionManager& );
virtual ~DropTargetDragContext();
@@ -81,10 +79,10 @@ namespace x11 {
::com::sun::star::datatransfer::dnd::XDragSourceContext
>
{
- XLIB_Window m_aDropWindow;
- XLIB_Time m_nTimestamp;
- SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ XLIB_Window m_aDropWindow;
+ XLIB_Time m_nTimestamp;
+ SelectionManager& m_rManager;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DragSourceContext();
@@ -98,3 +96,5 @@ namespace x11 {
} // namespace
#endif // _DTRANS_X11_DNDCONTEXT_HXX
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_droptarget.cxx
b/main/vcl/unx/generic/dtrans/X11_droptarget.cxx
index e3967f0363..f8ead42693 100644
--- a/main/vcl/unx/generic/dtrans/X11_droptarget.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_droptarget.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -71,14 +69,14 @@ void DropTarget::initialize( const Sequence< Any >&
arguments ) throw( ::com::su
m_xSelectionManager = static_cast< XDragSource*
>(m_pSelectionManager);
m_pSelectionManager->initialize( arguments );
- if( m_pSelectionManager->getDisplay() ) // #136582# sanity check
- {
- sal_Size aWindow = None;
- arguments.getConstArray()[1] >>= aWindow;
- m_pSelectionManager->registerDropTarget( aWindow, this );
- m_aTargetWindow = aWindow;
- m_bActive = true;
- }
+ if( m_pSelectionManager->getDisplay() ) // #136582# sanity check
+ {
+ sal_Size aWindow = None;
+ arguments.getConstArray()[1] >>= aWindow;
+ m_pSelectionManager->registerDropTarget( aWindow, this
);
+ m_aTargetWindow = aWindow;
+ m_bActive = true;
+ }
}
}
@@ -220,3 +218,5 @@ Sequence< OUString > DropTarget::getSupportedServiceNames()
throw()
{
return Xdnd_dropTarget_getSupportedServiceNames();
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_selection.cxx
b/main/vcl/unx/generic/dtrans/X11_selection.cxx
index 290c8d196b..0d32c9865b 100644
--- a/main/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -554,9 +554,9 @@ OUString SelectionManager::convertFromCompound( const char*
pText, int nLen )
aProp.format = 8;
aProp.nitems = nLen;
XmbTextPropertyToTextList( m_pDisplay,
- &aProp,
- &pTextList,
- &nTexts );
+ &aProp,
+ &pTextList,
+ &nTexts );
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
for( int i = 0; i < nTexts; i++ )
aRet += OStringToOUString( pTextList[i], aEncoding );
@@ -582,23 +582,23 @@ OString SelectionManager::convertToCompound( const
OUString& rText )
char* pT = const_cast<char*>(aRet.getStr());
XmbTextListToTextProperty( m_pDisplay,
- &pT,
- 1,
- XCompoundTextStyle,
- &aProp );
+ &pT,
+ 1,
+ XCompoundTextStyle,
+ &aProp );
if( aProp.value )
{
aRet = (char*)aProp.value;
XFree( aProp.value );
#ifdef SOLARIS
/* #97070#
- * for currently unknown reasons XmbTextListToTextProperty on Solaris
returns
- * no data in ISO8859-n encodings (at least for n = 1, 15)
- * in these encodings the directly converted text does the
- * trick, also.
- */
- if( ! aRet.getLength() && rText.getLength() )
- aRet = OUStringToOString( rText, osl_getThreadTextEncoding() );
+ * for currently unknown reasons XmbTextListToTextProperty on
Solaris returns
+ * no data in ISO8859-n encodings (at least for n = 1, 15)
+ * in these encodings the directly converted text does the
+ * trick, also.
+ */
+ if( ! aRet.getLength() && rText.getLength() )
+ aRet = OUStringToOString( rText,
osl_getThreadTextEncoding() );
#endif
}
else
@@ -610,11 +610,11 @@ OString SelectionManager::convertToCompound( const
OUString& rText )
// ------------------------------------------------------------------------
bool SelectionManager::convertData(
- const css::uno::Reference< XTransferable >&
xTransferable,
- Atom nType,
- Atom nSelection,
- int& rFormat,
- Sequence< sal_Int8 >& rData )
+ const
css::uno::Reference< XTransferable >& xTransferable,
+ Atom nType,
+ Atom
nSelection,
+ int& rFormat,
+ Sequence<
sal_Int8 >& rData )
{
bool bSuccess = false;
@@ -627,55 +627,55 @@ bool SelectionManager::convertData(
DataFlavor aFlavor;
aFlavor.MimeType = convertTypeFromNative( nType, nSelection,
rFormat );
- sal_Int32 nIndex = 0;
- if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii(
"text/plain" ) == 0 )
- {
- if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii(
"charset=utf-16" ) == 0 )
- aFlavor.DataType = getCppuType( (OUString *) 0 );
- else
- aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 );
- }
- else
- aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 );
+ sal_Int32 nIndex = 0;
+ if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii(
"text/plain" ) == 0 )
+ {
+ if( aFlavor.MimeType.getToken( 0, ';', nIndex
).compareToAscii( "charset=utf-16" ) == 0 )
+ aFlavor.DataType = getCppuType( (OUString *) 0
);
+ else
+ aFlavor.DataType = getCppuType( (Sequence<
sal_Int8 >*)0 );
+ }
+ else
+ aFlavor.DataType = getCppuType( (Sequence< sal_Int8
>*)0 );
- if( xTransferable->isDataFlavorSupported( aFlavor ) )
- {
- Any aValue( xTransferable->getTransferData( aFlavor ) );
- if( aValue.getValueTypeClass() == TypeClass_STRING )
- {
- OUString aString;
- aValue >>= aString;
- rData = Sequence< sal_Int8 >( (sal_Int8*)aString.getStr(),
aString.getLength() * sizeof( sal_Unicode ) );
- bSuccess = true;
- }
- else if( aValue.getValueType() == getCppuType( (Sequence< sal_Int8
>*)0 ) )
- {
- aValue >>= rData;
- bSuccess = true;
- }
- }
- else if( aFlavor.MimeType.compareToAscii( "text/plain", 10 ) == 0 )
- {
- rtl_TextEncoding aEncoding = RTL_TEXTENCODING_DONTKNOW;
- bool bCompoundText = false;
- if( nType == m_nCOMPOUNDAtom )
- bCompoundText = true;
- else
- aEncoding = getTextPlainEncoding( aFlavor.MimeType );
- if( aEncoding != RTL_TEXTENCODING_DONTKNOW || bCompoundText )
- {
- aFlavor.MimeType = OUString::createFromAscii(
"text/plain;charset=utf-16" );
- aFlavor.DataType = getCppuType( (OUString *) 0 );
- if( xTransferable->isDataFlavorSupported( aFlavor ) )
- {
- Any aValue( xTransferable->getTransferData( aFlavor ) );
- OUString aString;
- aValue >>= aString;
- OString aByteString( bCompoundText ? convertToCompound(
aString ) : OUStringToOString( aString, aEncoding ) );
- rData = Sequence< sal_Int8 >(
(sal_Int8*)aByteString.getStr(), aByteString.getLength() * sizeof( sal_Char ) );
- bSuccess = true;
- }
- }
+ if( xTransferable->isDataFlavorSupported( aFlavor ) )
+ {
+ Any aValue( xTransferable->getTransferData( aFlavor ) );
+ if( aValue.getValueTypeClass() == TypeClass_STRING )
+ {
+ OUString aString;
+ aValue >>= aString;
+ rData = Sequence< sal_Int8 >(
(sal_Int8*)aString.getStr(), aString.getLength() * sizeof( sal_Unicode ) );
+ bSuccess = true;
+ }
+ else if( aValue.getValueType() == getCppuType(
(Sequence< sal_Int8 >*)0 ) )
+ {
+ aValue >>= rData;
+ bSuccess = true;
+ }
+ }
+ else if( aFlavor.MimeType.compareToAscii( "text/plain", 10 ) ==
0 )
+ {
+ rtl_TextEncoding aEncoding = RTL_TEXTENCODING_DONTKNOW;
+ bool bCompoundText = false;
+ if( nType == m_nCOMPOUNDAtom )
+ bCompoundText = true;
+ else
+ aEncoding = getTextPlainEncoding(
aFlavor.MimeType );
+ if( aEncoding != RTL_TEXTENCODING_DONTKNOW ||
bCompoundText )
+ {
+ aFlavor.MimeType = OUString::createFromAscii(
"text/plain;charset=utf-16" );
+ aFlavor.DataType = getCppuType( (OUString *) 0
);
+ if( xTransferable->isDataFlavorSupported(
aFlavor ) )
+ {
+ Any aValue(
xTransferable->getTransferData( aFlavor ) );
+ OUString aString;
+ aValue >>= aString;
+ OString aByteString( bCompoundText ?
convertToCompound( aString ) : OUStringToOString( aString, aEncoding ) );
+ rData = Sequence< sal_Int8 >(
(sal_Int8*)aByteString.getStr(), aByteString.getLength() * sizeof( sal_Char ) );
+ bSuccess = true;
+ }
+ }
}
}
// various exceptions possible ... which all lead to a failed conversion
@@ -806,23 +806,23 @@ void SelectionManager::convertTypeToNative( const
OUString& rType, Atom selectio
if( ! pTab[i].nAtom )
pTab[i].nAtom = getAtom( OStringToOUString(
pTab[i].pNativeType, RTL_TEXTENCODING_ISO_8859_1 ) );
rFormat = pTab[i].nFormat;
- if( bPushFront )
- rConversions.push_front( pTab[i].nAtom );
- else
- rConversions.push_back( pTab[i].nAtom );
- if( pTab[i].nFormat == XA_PIXMAP )
- {
- if( bPushFront )
- {
- rConversions.push_front( XA_VISUALID );
- rConversions.push_front( XA_COLORMAP );
- }
- else
- {
- rConversions.push_back( XA_VISUALID );
- rConversions.push_back( XA_COLORMAP );
- }
- }
+ if( bPushFront )
+ rConversions.push_front( pTab[i].nAtom );
+ else
+ rConversions.push_back( pTab[i].nAtom );
+ if( pTab[i].nFormat == XA_PIXMAP )
+ {
+ if( bPushFront )
+ {
+ rConversions.push_front( XA_VISUALID );
+ rConversions.push_front( XA_COLORMAP );
+ }
+ else
+ {
+ rConversions.push_back( XA_VISUALID );
+ rConversions.push_back( XA_COLORMAP );
+ }
+ }
}
}
if( ! rFormat )
@@ -899,9 +899,9 @@ bool SelectionManager::getPasteData( Atom selection, Atom
type, Sequence< sal_In
OUString aSelection( getString( selection ) );
OUString aType( getString( type ) );
fprintf( stderr, "getPasteData( %s, native: %s )\n",
- OUStringToOString( aSelection, RTL_TEXTENCODING_ISO_8859_1
).getStr(),
- OUStringToOString( aType, RTL_TEXTENCODING_ISO_8859_1 ).getStr()
- );
+ OUStringToOString( aSelection,
RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
+ OUStringToOString( aType, RTL_TEXTENCODING_ISO_8859_1
).getStr()
+ );
#endif
if( ! m_pDisplay )
@@ -952,61 +952,61 @@ bool SelectionManager::getPasteData( Atom selection, Atom
type, Sequence< sal_In
bool bHandle = false;
if( XCheckTypedEvent( m_pDisplay,
- PropertyNotify,
- &aEvent
- ) )
- {
- bHandle = true;
- if( aEvent.xproperty.window == m_aWindow
- && aEvent.xproperty.atom == selection )
- bAdjustTime = true;
- }
- else
- if( XCheckTypedEvent( m_pDisplay,
- SelectionClear,
- &aEvent
- ) )
- {
- bHandle = true;
- }
- else
- if( XCheckTypedEvent( m_pDisplay,
- SelectionRequest,
- &aEvent
- ) )
- bHandle = true;
- else
- if( XCheckTypedEvent( m_pDisplay,
- SelectionNotify,
- &aEvent
- ) )
- {
- bHandle = true;
- if( aEvent.xselection.selection == selection
- && ( aEvent.xselection.requestor == m_aWindow ||
- aEvent.xselection.requestor == m_aCurrentDropWindow )
- )
- bAdjustTime = true;
- }
- else
- {
- TimeValue aTVal;
- aTVal.Seconds = 0;
- aTVal.Nanosec = 100000000;
- aGuard.clear();
- osl_waitThread( &aTVal );
- aGuard.reset();
- }
- if( bHandle )
- {
- aGuard.clear();
- handleXEvent( aEvent );
- aGuard.reset();
- }
- }
- gettimeofday( &tv_current, NULL );
- if( bAdjustTime )
- tv_last = tv_current;
+
PropertyNotify,
+ &aEvent
+ ) )
+ {
+ bHandle = true;
+ if( aEvent.xproperty.window == m_aWindow
+ && aEvent.xproperty.atom == selection )
+ bAdjustTime = true;
+ }
+ else
+ if( XCheckTypedEvent( m_pDisplay,
+
SelectionClear,
+ &aEvent
+ ) )
+ {
+ bHandle = true;
+ }
+ else
+ if( XCheckTypedEvent( m_pDisplay,
+
SelectionRequest,
+ &aEvent
+ ) )
+ bHandle = true;
+ else
+ if( XCheckTypedEvent( m_pDisplay,
+
SelectionNotify,
+ &aEvent
+ ) )
+ {
+ bHandle = true;
+ if( aEvent.xselection.selection == selection
+ && ( aEvent.xselection.requestor ==
m_aWindow ||
+ aEvent.xselection.requestor ==
m_aCurrentDropWindow )
+ )
+ bAdjustTime = true;
+ }
+ else
+ {
+ TimeValue aTVal;
+ aTVal.Seconds = 0;
+ aTVal.Nanosec = 100000000;
+ aGuard.clear();
+ osl_waitThread( &aTVal );
+ aGuard.reset();
+ }
+ if( bHandle )
+ {
+ aGuard.clear();
+ handleXEvent( aEvent );
+ aGuard.reset();
+ }
+ }
+ gettimeofday( &tv_current, NULL );
+ if( bAdjustTime )
+ tv_last = tv_current;
} while( ! it->second->m_aDataArrived.check() && (tv_current.tv_sec -
tv_last.tv_sec) < getSelectionTimeout() );
#if OSL_DEBUG_LEVEL > 1
@@ -1054,8 +1054,8 @@ bool SelectionManager::getPasteData( Atom selection,
const ::rtl::OUString& rTyp
const std::vector< Atom >& rNativeTypes( it->second->m_aNativeTypes );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "getPasteData( \"%s\", \"%s\" )\n",
- OUStringToOString( getString( selection ),
RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
- OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1 ).getStr()
);
+ OUStringToOString( getString( selection ),
RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
+ OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1
).getStr() );
#endif
if( rType.equalsAsciiL( "text/plain;charset=utf-16", 25 ) )
@@ -1074,12 +1074,12 @@ bool SelectionManager::getPasteData( Atom selection,
const ::rtl::OUString& rTyp
rData = Sequence< sal_Int8 >(
(sal_Int8*)aRet.getStr(), (aRet.getLength()+1)*sizeof( sal_Unicode ) );
bSuccess = true;
}
- else if( it->second->m_bHaveCompound &&
- getPasteData( selection,
- m_nCOMPOUNDAtom,
- aData )
- )
- {
+ else if( it->second->m_bHaveCompound &&
+ getPasteData( selection,
+ m_nCOMPOUNDAtom,
+ aData )
+ )
+ {
OUString aRet( convertFromCompound( (const
char*)aData.getConstArray(), aData.getLength() ) );
rData = Sequence< sal_Int8 >( (sal_Int8*)aRet.getStr(),
(aRet.getLength()+1)*sizeof( sal_Unicode ) );
bSuccess = true;
@@ -2310,16 +2310,16 @@ bool SelectionManager::handleDropEvent(
XClientMessageEvent& rMessage )
else
{
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "XdndDrop canceled due to m_bLastDropAccepted
= fale\n" );
+ fprintf( stderr, "XdndDrop canceled due to
m_bLastDropAccepted = false\n" );
#endif
- DropTargetEvent aEvent;
- aEvent.Source = static_cast< XDropTarget*
>(it->second.m_pTarget);
- aGuard.clear();
- it->second->dragExit( aEvent );
- // reset the drop status, notify source
- dropComplete( sal_False, m_aCurrentDropWindow, m_nDropTime );
- }
- }
+ DropTargetEvent aEvent;
+ aEvent.Source = static_cast< XDropTarget*
>(it->second.m_pTarget);
+ aGuard.clear();
+ it->second->dragExit( aEvent );
+ // reset the drop status, notify source
+ dropComplete( sal_False, m_aCurrentDropWindow,
m_nDropTime );
+ }
+ }
}
return bHandled;
}
@@ -2342,10 +2342,10 @@ void SelectionManager::dropComplete( sal_Bool bSuccess,
XLIB_Window aDropWindow,
dsde.DragSource = static_cast<
XDragSource* >(this);
dsde.DropAction = getUserDragAction();
dsde.DropSuccess = bSuccess;
- css::uno::Reference< XDragSourceListener > xListener =
m_xDragSourceListener;
+ css::uno::Reference< XDragSourceListener > xListener =
m_xDragSourceListener;
m_xDragSourceListener.clear();
- aGuard.clear();
+ aGuard.clear();
xListener->dragDropEnd( dsde );
}
else if( m_aDropEnterEvent.data.l[0] && m_aCurrentDropWindow )
@@ -2361,15 +2361,15 @@ void SelectionManager::dropComplete( sal_Bool bSuccess,
XLIB_Window aDropWindow,
aEvent.xclient.data.l[2] = 0;
aEvent.xclient.data.l[3] = 0;
aEvent.xclient.data.l[4] = 0;
- if( bSuccess )
- {
- if( m_nLastDropAction & DNDConstants::ACTION_MOVE )
- aEvent.xclient.data.l[2] = m_nXdndActionMove;
- else if( m_nLastDropAction & DNDConstants::ACTION_COPY )
- aEvent.xclient.data.l[2] = m_nXdndActionCopy;
- else if( m_nLastDropAction & DNDConstants::ACTION_LINK )
- aEvent.xclient.data.l[2] = m_nXdndActionLink;
- }
+ if( bSuccess )
+ {
+ if( m_nLastDropAction &
DNDConstants::ACTION_MOVE )
+ aEvent.xclient.data.l[2] =
m_nXdndActionMove;
+ else if( m_nLastDropAction &
DNDConstants::ACTION_COPY )
+ aEvent.xclient.data.l[2] =
m_nXdndActionCopy;
+ else if( m_nLastDropAction &
DNDConstants::ACTION_LINK )
+ aEvent.xclient.data.l[2] =
m_nXdndActionLink;
+ }
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "Sending XdndFinished to 0x%lx\n",
@@ -3637,28 +3637,28 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
* XGrabKeyboard -> solid lock.
*/
if( rEvent.xany.display != m_pDisplay
- && rEvent.type != ClientMessage
- && rEvent.type != ButtonPress
- && rEvent.type != ButtonRelease
- )
+ && rEvent.type != ClientMessage
+ && rEvent.type != ButtonPress
+ && rEvent.type != ButtonRelease
+ )
return false;
- bool bHandled = false;
+ bool bHandled = false;
switch (rEvent.type)
{
case SelectionClear:
{
- ClearableMutexGuard aGuard(m_aMutex);
+ ClearableMutexGuard aGuard(m_aMutex);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "SelectionClear for selection %s\n",
OUStringToOString( getString(
rEvent.xselectionclear.selection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr()
);
#endif
SelectionAdaptor* pAdaptor = getAdaptor(
rEvent.xselectionclear.selection );
- std::hash_map< Atom, Selection* >::iterator it(
m_aSelections.find( rEvent.xselectionclear.selection ) );
- if( it != m_aSelections.end() )
- it->second->m_bOwner = false;
- aGuard.clear();
+ std::hash_map< Atom, Selection* >::iterator it(
m_aSelections.find( rEvent.xselectionclear.selection ) );
+ if( it != m_aSelections.end() )
+ it->second->m_bOwner = false;
+ aGuard.clear();
if ( pAdaptor )
pAdaptor->clearTransferable();
}
@@ -3704,7 +3704,7 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
default:
;
}
- return bHandled;
+ return bHandled;
}
// ------------------------------------------------------------------------
@@ -3733,7 +3733,7 @@ void SelectionManager::dispatchEvent( int millisec )
// with an empty socket here
if( poll( &aPollFD, 1, 0 ) > 0 )
{
- int nPending = 1;
+ int nPending = 1;
while( nPending )
{
nPending = XPending( m_pDisplay );
@@ -3778,8 +3778,8 @@ void SelectionManager::run( void* pThis )
timeval aNow;
gettimeofday( &aNow, 0 );
- if( (aNow.tv_sec - aLast.tv_sec) > 0 )
- {
+ if( (aNow.tv_sec - aLast.tv_sec) > 0 )
+ {
ClearableMutexGuard aGuard(This->m_aMutex);
std::list< std::pair< SelectionAdaptor*, css::uno::Reference<
XInterface > > > aChangeList;
@@ -3804,7 +3804,7 @@ void SelectionManager::run( void* pThis )
aChangeList.pop_front();
}
aLast = aNow;
- }
+ }
}
#if OSL_DEBUG_LEVEL > 1
fprintf(stderr, "SelectionManager::run end\n" );
@@ -3813,44 +3813,44 @@ void SelectionManager::run( void* pThis )
void SelectionManager::shutdown() throw()
{
- ResettableMutexGuard aGuard(m_aMutex);
- if( m_bShutDown )
- {
- return;
- }
- m_bShutDown = true;
- // stop dispatching
- if( m_aThread )
- {
- osl_terminateThread( m_aThread );
- /*
- * Allow thread to finish before app exits to avoid pulling the carpet
- * out from under it if pasting is occurring during shutdown
- *
- * a) allow it to have the Mutex and
- * b) reschedule to allow it to complete callbacks to any
- * Application::GetSolarMutex protected regions, etc. e.g.
- * TransferableHelper::getTransferDataFlavors (via
- * SelectionManager::handleSelectionRequest) which it might
- * currently be trying to enter.
- *
- * Otherwise the thread may be left still waiting on a GlobalMutex
- * when that gets destroyed, letting the thread blow up and die
- * when enters the section in a now dead AOO instance.
- */
- aGuard.clear();
- while (osl_isThreadRunning(m_aThread))
- {
- vos::OGuard guard2(Application::GetSolarMutex());
- Application::Reschedule();
- }
- osl_joinWithThread( m_aThread );
- osl_destroyThread( m_aThread );
- m_aThread = NULL;
- aGuard.reset();
- }
- m_xDisplayConnection->removeEventHandler( Any(), this );
- m_xDisplayConnection.clear();
+ ResettableMutexGuard aGuard(m_aMutex);
+ if( m_bShutDown )
+ {
+ return;
+ }
+ m_bShutDown = true;
+ // stop dispatching
+ if( m_aThread )
+ {
+ osl_terminateThread( m_aThread );
+ /*
+ * Allow thread to finish before app exits to avoid pulling the
carpet
+ * out from under it if pasting is occurring during shutdown
+ *
+ * a) allow it to have the Mutex and
+ * b) reschedule to allow it to complete callbacks to any
+ * Application::GetSolarMutex protected regions, etc. e.g.
+ * TransferableHelper::getTransferDataFlavors (via
+ * SelectionManager::handleSelectionRequest) which it might
+ * currently be trying to enter.
+ *
+ * Otherwise the thread may be left still waiting on a
GlobalMutex
+ * when that gets destroyed, letting the thread blow up and die
+ * when enters the section in a now dead AOO instance.
+ */
+ aGuard.clear();
+ while (osl_isThreadRunning(m_aThread))
+ {
+ vos::OGuard guard2(Application::GetSolarMutex());
+ Application::Reschedule();
+ }
+ osl_joinWithThread( m_aThread );
+ osl_destroyThread( m_aThread );
+ m_aThread = NULL;
+ aGuard.reset();
+ }
+ m_xDisplayConnection->removeEventHandler( Any(), this );
+ m_xDisplayConnection.clear();
}
// ------------------------------------------------------------------------
@@ -3973,23 +3973,23 @@ void SelectionManager::registerDropTarget( XLIB_Window
aWindow, DropTarget* pTar
DropTargetEntry aEntry( pTarget );
bWasError=false;
/* #i100000# ugly workaround: gtk sets its own XErrorHandler
which is not suitable for us
- unfortunately XErrorHandler is not per display, so this is just and
ugly hack
- Need to remove separate display and integrate clipboard/dnd into
vcl's unx code ASAP
+ unfortunately XErrorHandler is not per display, so this is
just and ugly hack
+ Need to remove separate display and integrate clipboard/dnd
into vcl's unx code ASAP
*/
xerror_hdl_t pOldHandler = XSetErrorHandler(
local_xerror_handler );
XSelectInput( m_pDisplay, aWindow, PropertyChangeMask );
if( ! bWasError )
{
- // set XdndAware
- XChangeProperty( m_pDisplay, aWindow, m_nXdndAware,
XA_ATOM, 32, PropModeReplace, (unsigned char*)&nXdndProtocolRevision, 1 );
- if( ! bWasError )
- {
- // get root window of window (in 99.999% of all cases
this will be
- // DefaultRootWindow( m_pDisplay )
- int x, y;
- unsigned int w, h, bw, d;
- XGetGeometry( m_pDisplay, aWindow,
&aEntry.m_aRootWindow,
- &x, &y, &w, &h, &bw, &d );
+ // set XdndAware
+ XChangeProperty( m_pDisplay, aWindow, m_nXdndAware,
XA_ATOM, 32, PropModeReplace, (unsigned char*)&nXdndProtocolRevision, 1 );
+ if( ! bWasError )
+ {
+ // get root window of window (in 99.999% of all
cases this will be
+ // DefaultRootWindow( m_pDisplay )
+ int x, y;
+ unsigned int w, h, bw, d;
+ XGetGeometry( m_pDisplay, aWindow,
&aEntry.m_aRootWindow,
+ &x, &y, &w, &h, &bw,
&d );
}
}
XSetErrorHandler( pOldHandler );
@@ -4022,17 +4022,17 @@ void SelectionManager::deregisterDropTarget(
XLIB_Window aWindow )
}
else if( m_aDropProxy != None && m_nCurrentProtocolVersion >= 0
)
{
- // send XdndLeave
- XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndLeave;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
- memset( aEvent.xclient.data.l+1, 0, sizeof(long)*4);
- m_aDropWindow = m_aDropProxy = None;
- XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent
);
+ // send XdndLeave
+ XEvent aEvent;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndLeave;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
+ memset( aEvent.xclient.data.l+1, 0, sizeof(long)*4);
+ m_aDropWindow = m_aDropProxy = None;
+ XSendEvent( m_pDisplay, m_aDropProxy, False,
NoEventMask, &aEvent );
}
// notify the listener
DragSourceDropEvent dsde;
@@ -4138,11 +4138,11 @@ sal_Int32 SelectionManagerHolder::getDefaultCursor(
sal_Int8 dragAction ) throw(
// ------------------------------------------------------------------------
void SelectionManagerHolder::startDrag(
- const
::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
- sal_Int8 sourceActions, sal_Int32
cursor, sal_Int32 image,
- const css::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& transferable,
- const css::uno::Reference<
::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
- ) throw()
+
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
+
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
+
const css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >&
transferable,
+
const css::uno::Reference<
::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ )
throw()
{
if( m_xRealDragSource.is() )
m_xRealDragSource->startDrag( trigger, sourceActions, cursor,
image, transferable, listener );
diff --git a/main/vcl/unx/generic/dtrans/X11_service.cxx
b/main/vcl/unx/generic/dtrans/X11_service.cxx
index db471d97f0..8a0d8656ef 100644
--- a/main/vcl/unx/generic/dtrans/X11_service.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_service.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -73,14 +71,14 @@ Sequence< OUString > SAL_CALL
x11::Xdnd_dropTarget_getSupportedServiceNames()
css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const
Sequence< Any >& arguments )
{
- static std::hash_map< OUString, ::std::hash_map< Atom,
css::uno::Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
+ static std::hash_map< OUString, ::std::hash_map< Atom,
css::uno::Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
OUString aDisplayName;
- Atom nSelection;
+ Atom nSelection;
- // extract display name from connection argument. An exception is thrown
- // by SelectionManager.initialize() if no display connection is given.
- if( arguments.getLength() > 0 )
+ // extract display name from connection argument. An exception is thrown
+ // by SelectionManager.initialize() if no display connection is given.
+ if( arguments.getLength() > 0 )
{
css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
@@ -95,19 +93,19 @@ css::uno::Reference< XInterface >
X11SalInstance::CreateClipboard( const Sequenc
SelectionManager& rManager = SelectionManager::get( aDisplayName );
rManager.initialize( arguments );
- // check if any other selection than clipboard selection is specified
- if( arguments.getLength() > 1 )
- {
- OUString aSelectionName;
+ // check if any other selection than clipboard selection is specified
+ if( arguments.getLength() > 1 )
+ {
+ OUString aSelectionName;
- arguments.getConstArray()[1] >>= aSelectionName;
- nSelection = rManager.getAtom( aSelectionName );
- }
- else
- {
- // default atom is clipboard selection
- nSelection = rManager.getAtom( OUString::createFromAscii( "CLIPBOARD"
) );
- }
+ arguments.getConstArray()[1] >>= aSelectionName;
+ nSelection = rManager.getAtom( aSelectionName );
+ }
+ else
+ {
+ // default atom is clipboard selection
+ nSelection = rManager.getAtom( OUString::createFromAscii(
"CLIPBOARD" ) );
+ }
::std::hash_map< Atom, css::uno::Reference< XClipboard > >& rMap(
m_aInstances[ aDisplayName ] );
::std::hash_map< Atom, css::uno::Reference< XClipboard > >::iterator it
= rMap.find( nSelection );
@@ -133,3 +131,5 @@ css::uno::Reference< XInterface >
X11SalInstance::CreateDropTarget()
{
return css::uno::Reference < XInterface >( ( OWeakObject * ) new
DropTarget() );
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_transferable.cxx
b/main/vcl/unx/generic/dtrans/X11_transferable.cxx
index a6c1316758..57dca3506c 100644
--- a/main/vcl/unx/generic/dtrans/X11_transferable.cxx
+++ b/main/vcl/unx/generic/dtrans/X11_transferable.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -64,7 +62,7 @@ X11Transferable::~X11Transferable()
//==================================================================================================
Any SAL_CALL X11Transferable::getTransferData( const DataFlavor& rFlavor )
- throw(UnsupportedFlavorException, IOException, RuntimeException)
+ throw(UnsupportedFlavorException, IOException, RuntimeException)
{
Any aRet;
Sequence< sal_Int8 > aData;
@@ -97,7 +95,7 @@ Any SAL_CALL X11Transferable::getTransferData( const
DataFlavor& rFlavor )
//==================================================================================================
Sequence< DataFlavor > SAL_CALL X11Transferable::getTransferDataFlavors()
- throw(RuntimeException)
+ throw(RuntimeException)
{
Sequence< DataFlavor > aFlavorList;
bool bSuccess = m_rManager.getPasteDataTypes( m_aSelection ?
m_aSelection : XA_PRIMARY, aFlavorList );
@@ -110,7 +108,7 @@ Sequence< DataFlavor > SAL_CALL
X11Transferable::getTransferDataFlavors()
//==================================================================================================
sal_Bool SAL_CALL X11Transferable::isDataFlavorSupported( const DataFlavor&
aFlavor )
- throw(RuntimeException)
+ throw(RuntimeException)
{
if( aFlavor.DataType != getCppuType( (Sequence< sal_Int8 >*)0 ) )
{
@@ -127,3 +125,5 @@ sal_Bool SAL_CALL X11Transferable::isDataFlavorSupported(
const DataFlavor& aFla
return sal_False;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/unx/generic/dtrans/X11_transferable.hxx
b/main/vcl/unx/generic/dtrans/X11_transferable.hxx
index 9850616ef2..a88457947f 100644
--- a/main/vcl/unx/generic/dtrans/X11_transferable.hxx
+++ b/main/vcl/unx/generic/dtrans/X11_transferable.hxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef _DTRANS_X11_TRANSFERABLE_HXX_
#define _DTRANS_X11_TRANSFERABLE_HXX_
@@ -43,7 +41,7 @@ namespace x11 {
com::sun::star::uno::Reference< XInterface >
m_xCreator;
Atom m_aSelection;
public:
- X11Transferable( SelectionManager& rManager, const
com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
+ X11Transferable( SelectionManager& rManager, const
com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
virtual ~X11Transferable();
/*
@@ -66,3 +64,5 @@ namespace x11 {
} // namespace
#endif
+
+/* vim: set noet sw=4 ts=4: */