Hi,
I am trying to get the selection of the current window starting from
AquaSalFrame, with this line:
uno::Reference<datatransfer::clipboard::XClipboard>
aSelection(pWin2->GetPrimarySelection());
but aSelection.is() is always false.
I tried a lot of different stuff for pWin2, including:
1) looping over GetSalData()->maFrames...->GetWindow();
2) pWin2 = mpFrame->GetWindow()
3) Reference< XDesktop > xDesktop(
::comphelper::getProcessServiceFactory()->createInstance( OUString(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
UNO_QUERY );
if ( xDesktop.is() )
{
Reference< XFrame > xFrame = xDesktop->getCurrentFrame();
if ( xFrame.is() )
{
Reference< XWindow > xWindow = xFrame->getComponentWindow();
if ( xWindow.is() ) pWin2 =
VCLUnoHelper::GetWindow( xWindow );
When selection a word in writer, GetPrimarySelection is also called and
I copied the this pointer manually to pwin2, but this as well did not work.
Could someone explain to me what the different window pointers refer to
exactly and how I can get the selection to work?
Best regards
Max
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]