2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-11-03 08:06:12 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
2008-04-11 08:06:13 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-11-03 08:06:12 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 11:16:05 +00:00
|
|
|
|
2000-11-03 08:06:12 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-06-27 19:28:34 +00:00
|
|
|
#include <vcl/cmdevt.hxx>
|
2000-11-03 08:06:12 +00:00
|
|
|
|
|
|
|
CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
|
2010-09-29 15:46:40 +08:00
|
|
|
const sal_uInt16* pTextAttr,
|
2000-11-06 19:33:25 +00:00
|
|
|
xub_StrLen nCursorPos,
|
2010-09-29 15:46:40 +08:00
|
|
|
sal_uInt16 nCursorFlags,
|
2000-11-06 19:33:25 +00:00
|
|
|
xub_StrLen nDeltaStart,
|
|
|
|
xub_StrLen nOldTextLen,
|
2010-09-29 15:46:40 +08:00
|
|
|
sal_Bool bOnlyCursor ) :
|
2000-11-03 08:06:12 +00:00
|
|
|
maText( rText )
|
|
|
|
{
|
|
|
|
if ( pTextAttr && maText.Len() )
|
|
|
|
{
|
2010-09-29 15:46:40 +08:00
|
|
|
mpTextAttr = new sal_uInt16[maText.Len()];
|
|
|
|
memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) );
|
2000-11-03 08:06:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
mpTextAttr = NULL;
|
|
|
|
mnCursorPos = nCursorPos;
|
|
|
|
mnDeltaStart = nDeltaStart;
|
|
|
|
mnOldTextLen = nOldTextLen;
|
2000-11-06 20:09:02 +00:00
|
|
|
mnCursorFlags = nCursorFlags;
|
2000-11-03 08:06:12 +00:00
|
|
|
mbOnlyCursor = bOnlyCursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData& rData ) :
|
|
|
|
maText( rData.maText )
|
|
|
|
{
|
|
|
|
if ( rData.mpTextAttr && maText.Len() )
|
|
|
|
{
|
2010-09-29 15:46:40 +08:00
|
|
|
mpTextAttr = new sal_uInt16[maText.Len()];
|
|
|
|
memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) );
|
2000-11-03 08:06:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
mpTextAttr = NULL;
|
|
|
|
mnCursorPos = rData.mnCursorPos;
|
|
|
|
mnDeltaStart = rData.mnDeltaStart;
|
|
|
|
mnOldTextLen = rData.mnOldTextLen;
|
|
|
|
mnCursorFlags = rData.mnCursorFlags;
|
|
|
|
mbOnlyCursor = rData.mbOnlyCursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
CommandExtTextInputData::~CommandExtTextInputData()
|
|
|
|
{
|
|
|
|
if ( mpTextAttr )
|
2003-06-30 13:30:09 +00:00
|
|
|
delete [] mpTextAttr;
|
2000-11-03 08:06:12 +00:00
|
|
|
}
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|