Kaydet (Commit) d51109a2 authored tarafından jp's avatar jp

use new clipboard

üst 4fca5648
......@@ -2,9 +2,9 @@
*
* $RCSfile: gloshdl.cxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: os $ $Date: 2000-10-17 15:15:44 $
* last change: $Author: jp $ $Date: 2001-02-02 17:46:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -142,8 +142,8 @@
#ifndef _GLOSLST_HXX
#include <gloslst.hxx>
#endif
#ifndef _DATAEX_HXX
#include <dataex.hxx>
#ifndef _SWDTFLVR_HXX
#include <swdtflvr.hxx>
#endif
#ifndef _DOCSH_HXX
#include <docsh.hxx>
......@@ -817,23 +817,13 @@ void SwGlossaryHdl::SetMacros(const String& rShortName,
SwTextBlocks *pGlos = pGlossary ? pGlossary :
pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc( aCurGrp );
int nIdx = pGlos->GetIndex( rShortName );
pGlos->BeginGetDoc( nIdx );
SwDoc* pDoc = pGlos->GetDoc();
SvxMacroTableDtor aMacroTbl;
if( pStart )
pDoc->SetGlobalMacro( SW_EVENT_START_INS_GLOSSARY, *pStart );
else
pDoc->DelGlobalMacro( SW_EVENT_START_INS_GLOSSARY );
aMacroTbl.Insert( SW_EVENT_START_INS_GLOSSARY, new SvxMacro(*pStart));
if( pEnd )
pDoc->SetGlobalMacro( SW_EVENT_END_INS_GLOSSARY, *pEnd );
else
pDoc->DelGlobalMacro( SW_EVENT_END_INS_GLOSSARY );
pGlos->EndGetDoc();
pGlos->BeginPutDoc( rShortName, pGlos->GetLongName( nIdx ) );
pGlos->PutDoc();
if( pGlos->GetError() )
aMacroTbl.Insert( SW_EVENT_END_INS_GLOSSARY, new SvxMacro(*pEnd));
int nIdx = pGlos->GetIndex( rShortName );
if( !pGlos->SetMacroTable( nIdx, aMacroTbl ) && pGlos->GetError() )
ErrorHandler::HandleError( pGlos->GetError() );
if(!pCurGrp && !pGlossary)
......@@ -961,8 +951,12 @@ BOOL SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName)
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
SwDataExchangeRef xExch = new SwDataExchange( rSh );
int nRet = xExch->CopyGlossary( *pGlossary, rShortName );
SwTransferable* pTransfer = new SwTransferable( rSh );
/*??*/::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable > xRef( pTransfer );
int nRet = pTransfer->CopyGlossary( *pGlossary, rShortName );
if( !pCurGrp )
rStatGlossaries.PutGroupDoc( pGlossary );
return 0 != nRet;
......@@ -1012,6 +1006,9 @@ String SwGlossaryHdl::GetValidShortCut( const String& rLong,
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.2 2000/10/17 15:15:44 os
Change: SfxMedium Ctor
Revision 1.1.1.1 2000/09/18 17:14:34 hr
initial import
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: basesh.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: jp $ $Date: 2000-12-22 12:07:32 $
* last change: $Author: jp $ $Date: 2001-02-02 17:43:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -245,6 +245,9 @@
#ifndef _DATAEX_HXX
#include <dataex.hxx>
#endif
#ifndef _SWDTFLVR_HXX
#include <swdtflvr.hxx>
#endif
#ifndef _PAGEDESC_HXX
#include <pagedesc.hxx>
#endif
......@@ -473,27 +476,34 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
rView.GetEditWin().FlushInBuffer( &rSh );
if ( rSh.HasSelection() )
{
SwDataExchangeRef aDataEx( new SwDataExchange( rSh ) );
SwTransferable* pTransfer = new SwTransferable( rSh );
/*??*/ ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable > xRef(
pTransfer );
if ( nId == SID_CUT )
aDataEx->Cut();
pTransfer->Cut();
else
aDataEx->Copy( FALSE );
pTransfer->Copy();
break;
}
return;
case SID_PASTE:
{
SVDATAOBJ;
if ( xObj.Is() && SwDataExchange::IsPaste( GetShell(), *xObj ) )
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard() );
if( aDataHelper.GetTransferable().is() &&
SwTransferable::IsPaste( rSh, aDataHelper ))
{
// temp. Variablen, da die Shell nach dem Paste schon
// zerstoert sein kann
SwView* pView = &rView;
SwDataExchange::Paste( rSh, *xObj );
if( rSh.IsFrmSelected() || rSh.IsObjSelected())
SwTransferable::Paste( rSh, aDataHelper );
if( rSh.IsFrmSelected() || rSh.IsObjSelected() )
rSh.EnterSelFrmMode();
pView->AttrChangedNotify(&rSh);
pView->AttrChangedNotify( &rSh );
}
else
return;
......@@ -501,23 +511,25 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
break;
case FN_PASTESPECIAL:
{
SVDATAOBJ;
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard() );
int nRet;
if ( xObj.Is() &&
SwDataExchange::IsPasteSpecial( rSh, *xObj ) )
if( aDataHelper.GetTransferable().is() &&
SwTransferable::IsPaste( rSh, aDataHelper ))
{
// temp. Variablen, da die Shell nach dem Paste schon
// zerstoert sein kann
SwView* pView = &rView;
nRet = SwDataExchange::PasteSpecial( rSh, *xObj );
rReq.SetReturnValue( SfxInt16Item( nId,
SwTransferable::PasteSpecial( rSh, aDataHelper )));
if (rSh.IsFrmSelected() || rSh.IsObjSelected())
rSh.EnterSelFrmMode();
pView->AttrChangedNotify(&rSh);
pView->AttrChangedNotify( &rSh );
}
else
return;
rReq.SetReturnValue(SfxInt16Item(nId, nRet));
}
break;
default:
......@@ -536,7 +548,6 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
SfxWhichIter aIter(rSet);
const BOOL bCopy = rSh.HasSelection();
SVDATAOBJ;
USHORT nWhich = aIter.FirstWhich();
......@@ -555,13 +566,24 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
break;
case SID_PASTE:
if( !xObj.Is() || !SwDataExchange::IsPaste( rSh, *xObj))
rSet.DisableItem( SID_PASTE );
{
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard() );
if( !aDataHelper.GetTransferable().is() ||
!SwTransferable::IsPaste( rSh, aDataHelper ))
rSet.DisableItem( SID_PASTE );
}
break;
case FN_PASTESPECIAL:
if( !xObj.Is() ||
!SwDataExchange::IsPasteSpecial( rSh, *xObj ) )
rSet.DisableItem( FN_PASTESPECIAL );
{
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard() );
if( !aDataHelper.GetTransferable().is() ||
!SwTransferable::IsPasteSpecial( rSh, aDataHelper ))
rSet.DisableItem( FN_PASTESPECIAL );
}
break;
}
nWhich = aIter.NextWhich();
......@@ -2515,6 +2537,9 @@ void SwBaseShell::ExecField( SfxRequest& rReq )
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.4 2000/12/22 12:07:32 jp
Bug #81672#: asynch loaded graphics for status updates
Revision 1.3 2000/11/23 20:08:52 jp
Task #80648#: use new class SvxScriptSetItem
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: drwtxtex.cxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: jp $ $Date: 2000-11-24 13:14:12 $
* last change: $Author: jp $ $Date: 2001-02-02 17:43:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -211,8 +211,8 @@
#ifndef _PARDLG_HXX
#include <pardlg.hxx>
#endif
#ifndef _DATAEX_HXX
#include <dataex.hxx>
#ifndef _SWDTFLVR_HXX
#include <swdtflvr.hxx>
#endif
#ifndef _DRWTXTSH_HXX
#include <drwtxtsh.hxx>
......@@ -682,7 +682,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
return;
ESelection aSel(pOLV->GetSelection());
const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos);
const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) ||
(aSel.nStartPos != aSel.nEndPos);
SfxWhichIter aIter(rSet);
......@@ -700,17 +701,11 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
case SID_PASTE:
{
//!!OS: das muss ein if/else bleiben, weil BLC das
// nicht anders versteht
SwModule* pMod = SW_MOD();
SvDataObjectRef xObj;
if( pMod->pClipboard )
xObj = pMod->pClipboard;
else
xObj = SvDataObject::PasteClipboard();
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard() );
if( !xObj.Is() ||
!SwDataExchange::IsPaste( GetShell(), *xObj ) )
if( !aDataHelper.GetTransferable().is() ||
!SwTransferable::IsPaste( GetShell(), aDataHelper ))
rSet.DisableItem( SID_PASTE );
}
break;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: textsh1.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: os $ $Date: 2001-01-10 16:07:03 $
* last change: $Author: jp $ $Date: 2001-02-02 17:43:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -170,8 +170,8 @@
#ifndef _BREAK_HXX
#include <break.hxx>
#endif
#ifndef _DATAEX_HXX
#include <dataex.hxx>
#ifndef _SWDTFLVR_HXX
#include <swdtflvr.hxx>
#endif
#ifndef _DOCSTAT_HXX
#include <docstat.hxx>
......@@ -441,10 +441,13 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
break;
case FN_CALCULATE:
{
SwDataExchangeRef aRef( new SwDataExchange( rWrtSh ) );
aRef->CalculateAndCopy();
}
{
SwTransferable* pTransfer = new SwTransferable( rWrtSh );
/*??*/ ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable > xRef(
pTransfer );
pTransfer->CalculateAndCopy();
}
break;
case FN_GOTO_REFERENCE:
{
......@@ -1022,6 +1025,9 @@ void SwTextShell::GetState( SfxItemSet &rSet )
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.3 2001/01/10 16:07:03 os
Ruby dialog
Revision 1.2 2000/10/06 13:36:37 jp
should changes: don't use IniManager
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment