Files
libreoffice/vcl/source/control/edit.cxx

3164 lines
103 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +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-09-18 16:07:07 +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-09-18 16:07:07 +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-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <tools/rc.h>
#include <vcl/svdata.hxx>
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svids.hrc>
#include <vcl/menu.hxx>
#include <vcl/cmdevt.h>
#include <vcl/subedit.hxx>
#include <vcl/edit.hxx>
#include <vcl/svapp.hxx>
#include <vcl/controldata.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/window.h>
#include <osl/mutex.hxx>
2001-05-11 06:26:03 +00:00
#include <com/sun/star/i18n/XBreakIterator.hpp>
2000-11-20 16:52:32 +00:00
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
2001-02-12 11:57:52 +00:00
#include <cppuhelper/weak.hxx>
#include <com/sun/star/datatransfer/XTransferable.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
2001-05-11 06:26:03 +00:00
#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
2001-02-12 11:57:52 +00:00
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
2001-02-14 07:32:01 +00:00
#include <rtl/memory.h>
#include <sal/macros.h>
2001-02-12 11:57:52 +00:00
#include <vcl/unohelp.hxx>
#include <vcl/unohelp2.hxx>
2000-09-18 16:07:07 +00:00
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::rtl;
// - Redo
// - Bei Tracking-Cancel DefaultSelection wieder herstellen
// =======================================================================
static FncGetSpecialChars pImplFncGetSpecialChars = NULL;
// =======================================================================
#define EDIT_ALIGN_LEFT 1
#define EDIT_ALIGN_CENTER 2
#define EDIT_ALIGN_RIGHT 3
#define EDIT_DEL_LEFT 1
#define EDIT_DEL_RIGHT 2
#define EDIT_DELMODE_SIMPLE 11
#define EDIT_DELMODE_RESTOFWORD 12
#define EDIT_DELMODE_RESTOFCONTENT 13
// =======================================================================
struct DDInfo
{
Cursor aCursor;
2001-05-11 06:26:03 +00:00
Selection aDndStartSel;
2000-09-18 16:07:07 +00:00
xub_StrLen nDropPos;
sal_Bool bStarterOfDD;
sal_Bool bDroppedInMe;
sal_Bool bVisCursor;
sal_Bool bIsStringSupported;
2000-09-18 16:07:07 +00:00
DDInfo()
{
aCursor.SetStyle( CURSOR_SHADOW );
nDropPos = 0;
bStarterOfDD = sal_False;
bDroppedInMe = sal_False;
bVisCursor = sal_False;
bIsStringSupported = sal_False;
2000-09-18 16:07:07 +00:00
}
};
// =======================================================================
struct Impl_IMEInfos
{
2001-06-12 13:42:19 +00:00
String aOldTextAfterStartPos;
sal_uInt16* pAttribs;
2000-09-18 16:07:07 +00:00
xub_StrLen nPos;
xub_StrLen nLen;
sal_Bool bCursor;
sal_Bool bWasCursorOverwrite;
2000-09-18 16:07:07 +00:00
2001-06-12 13:42:19 +00:00
Impl_IMEInfos( xub_StrLen nPos, const String& rOldTextAfterStartPos );
2000-09-18 16:07:07 +00:00
~Impl_IMEInfos();
void CopyAttribs( const xub_StrLen* pA, xub_StrLen nL );
void DestroyAttribs();
};
// -----------------------------------------------------------------------
2001-06-12 13:42:19 +00:00
Impl_IMEInfos::Impl_IMEInfos( xub_StrLen nP, const String& rOldTextAfterStartPos )
: aOldTextAfterStartPos( rOldTextAfterStartPos )
2000-09-18 16:07:07 +00:00
{
nPos = nP;
nLen = 0;
bCursor = sal_True;
2000-09-18 16:07:07 +00:00
pAttribs = NULL;
bWasCursorOverwrite = sal_False;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Impl_IMEInfos::~Impl_IMEInfos()
{
2002-07-17 09:56:34 +00:00
delete[] pAttribs;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Impl_IMEInfos::CopyAttribs( const xub_StrLen* pA, xub_StrLen nL )
{
nLen = nL;
2002-07-17 09:56:34 +00:00
delete[] pAttribs;
pAttribs = new sal_uInt16[ nL ];
rtl_copyMemory( pAttribs, pA, nL*sizeof(sal_uInt16) );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Impl_IMEInfos::DestroyAttribs()
{
2002-07-17 09:56:34 +00:00
delete[] pAttribs;
2000-09-18 16:07:07 +00:00
pAttribs = NULL;
2001-05-03 07:19:53 +00:00
nLen = 0;
2000-09-18 16:07:07 +00:00
}
// =======================================================================
Edit::Edit( WindowType nType ) :
Control( nType )
{
ImplInitEditData();
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Edit::Edit( Window* pParent, WinBits nStyle ) :
Control( WINDOW_EDIT )
{
ImplInitEditData();
2000-09-18 16:07:07 +00:00
ImplInit( pParent, nStyle );
}
// -----------------------------------------------------------------------
Edit::Edit( Window* pParent, const ResId& rResId ) :
Control( WINDOW_EDIT )
{
ImplInitEditData();
2000-09-18 16:07:07 +00:00
rResId.SetRT( RSC_EDIT );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
// Derived MultiLineEdit takes care to call Show only after MultiLineEdit
// ctor has already started:
if ( !(nStyle & WB_HIDE) && rResId.GetRT() != RSC_MULTILINEEDIT )
2000-09-18 16:07:07 +00:00
Show();
}
// -----------------------------------------------------------------------
Edit::Edit( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabeledByRelation ) :
Control( WINDOW_EDIT )
{
ImplInitEditData();
rResId.SetRT( RSC_EDIT );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabeledByRelation )
ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = sal_True;
// Derived MultiLineEdit takes care to call Show only after MultiLineEdit
// ctor has already started:
if ( !(nStyle & WB_HIDE) && rResId.GetRT() != RSC_MULTILINEEDIT )
Show();
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
Edit::~Edit()
{
delete mpDDInfo;
Cursor* pCursor = GetCursor();
if ( pCursor )
{
SetCursor( NULL );
delete pCursor;
}
delete mpIMEInfos;
if ( mpUpdateDataTimer )
delete mpUpdateDataTimer;
2001-05-11 06:26:03 +00:00
2002-01-18 07:30:09 +00:00
if ( mxDnDListener.is() )
{
if ( GetDragGestureRecognizer().is() )
{
uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL( mxDnDListener, uno::UNO_QUERY );
GetDragGestureRecognizer()->removeDragGestureListener( xDGL );
}
if ( GetDropTarget().is() )
{
uno::Reference< datatransfer::dnd::XDropTargetListener> xDTL( mxDnDListener, uno::UNO_QUERY );
GetDropTarget()->removeDropTargetListener( xDTL );
}
uno::Reference< lang::XEventListener> xEL( mxDnDListener, uno::UNO_QUERY );
xEL->disposing( lang::EventObject() ); // #95154# #96585# Empty Source means it's the Client
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplInitEditData()
2000-09-18 16:07:07 +00:00
{
mpSubEdit = NULL;
mpUpdateDataTimer = NULL;
mnXOffset = 0;
mnAlign = EDIT_ALIGN_LEFT;
mnMaxTextLen = EDIT_NOLIMIT;
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
mbModified = sal_False;
mbInternModified = sal_False;
mbReadOnly = sal_False;
mbInsertMode = sal_True;
mbClickedInSelection = sal_False;
mbActivePopup = sal_False;
mbIsSubEdit = sal_False;
mbInMBDown = sal_False;
2000-09-18 16:07:07 +00:00
mpDDInfo = NULL;
mpIMEInfos = NULL;
mcEchoChar = 0;
2001-05-11 06:26:03 +00:00
2002-09-12 07:35:13 +00:00
// --- RTL --- no default mirroring for Edit controls
// note: controls that use a subedit will revert this (SpinField, ComboBox)
EnableRTL( sal_False );
2002-09-12 07:35:13 +00:00
2001-05-11 06:26:03 +00:00
vcl::unohelper::DragAndDropWrapper* pDnDWrapper = new vcl::unohelper::DragAndDropWrapper( this );
mxDnDListener = pDnDWrapper;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
bool Edit::ImplUseNativeBorder( WinBits nStyle )
{
bool bRet =
IsNativeControlSupported(ImplGetNativeControlType(), HAS_BACKGROUND_TEXTURE)
&& ((nStyle&WB_BORDER) && !(nStyle&WB_NOBORDER));
if( ! bRet && mbIsSubEdit )
{
Window* pWindow = GetParent();
nStyle = pWindow->GetStyle();
bRet = pWindow->IsNativeControlSupported(ImplGetNativeControlType(), HAS_BACKGROUND_TEXTURE)
&& ((nStyle&WB_BORDER) && !(nStyle&WB_NOBORDER));
}
return bRet;
}
2000-09-18 16:07:07 +00:00
void Edit::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
if ( !(nStyle & (WB_CENTER | WB_RIGHT)) )
nStyle |= WB_LEFT;
Control::ImplInit( pParent, nStyle, NULL );
mbReadOnly = (nStyle & WB_READONLY) != 0;
mnAlign = EDIT_ALIGN_LEFT;
2002-09-12 07:35:13 +00:00
// --- RTL --- hack: right align until keyinput and cursor travelling works
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
if( IsRTLEnabled() )
2002-09-12 07:35:13 +00:00
mnAlign = EDIT_ALIGN_RIGHT;
2000-09-18 16:07:07 +00:00
if ( nStyle & WB_RIGHT )
mnAlign = EDIT_ALIGN_RIGHT;
else if ( nStyle & WB_CENTER )
mnAlign = EDIT_ALIGN_CENTER;
SetCursor( new Cursor );
SetPointer( Pointer( POINTER_TEXT ) );
ImplInitSettings( sal_True, sal_True, sal_True );
2001-05-11 06:26:03 +00:00
uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL( mxDnDListener, uno::UNO_QUERY );
uno::Reference< datatransfer::dnd::XDragGestureRecognizer > xDGR = GetDragGestureRecognizer();
if ( xDGR.is() )
{
xDGR->addDragGestureListener( xDGL );
uno::Reference< datatransfer::dnd::XDropTargetListener> xDTL( mxDnDListener, uno::UNO_QUERY );
GetDropTarget()->addDropTargetListener( xDTL );
GetDropTarget()->setActive( sal_True );
GetDropTarget()->setDefaultActions( datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE );
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
WinBits Edit::ImplInitStyle( WinBits nStyle )
{
if ( !(nStyle & WB_NOTABSTOP) )
nStyle |= WB_TABSTOP;
if ( !(nStyle & WB_NOGROUP) )
nStyle |= WB_GROUP;
return nStyle;
}
// -----------------------------------------------------------------------
sal_Bool Edit::IsCharInput( const KeyEvent& rKeyEvent )
2000-09-18 16:07:07 +00:00
{
// In the future we must use new Unicode functions for this
xub_Unicode cCharCode = rKeyEvent.GetCharCode();
return ((cCharCode >= 32) && (cCharCode != 127) &&
!rKeyEvent.GetKeyCode().IsMod3() &&
!rKeyEvent.GetKeyCode().IsMod2() &&
!rKeyEvent.GetKeyCode().IsMod1() );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplModified()
{
mbModified = sal_True;
2000-09-18 16:07:07 +00:00
Modify();
}
// -----------------------------------------------------------------------
void Edit::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
2000-09-18 16:07:07 +00:00
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( bFont )
{
Font aFont = rStyleSettings.GetFieldFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
SetZoomedPointFont( aFont );
ImplClearLayoutData();
2000-09-18 16:07:07 +00:00
}
if ( bFont || bForeground )
{
Color aTextColor = rStyleSettings.GetFieldTextColor();
if ( IsControlForeground() )
aTextColor = GetControlForeground();
SetTextColor( aTextColor );
}
if ( bBackground )
{
if ( ImplUseNativeBorder( GetStyle() ) || IsPaintTransparent() )
{
// Transparent background
SetBackground();
SetFillColor();
}
else if ( IsControlBackground() )
2000-09-18 16:07:07 +00:00
{
SetBackground( GetControlBackground() );
SetFillColor( GetControlBackground() );
}
else
{
SetBackground( rStyleSettings.GetFieldColor() );
SetFillColor( rStyleSettings.GetFieldColor() );
}
}
}
// -----------------------------------------------------------------------
long Edit::ImplGetExtraOffset() const
{
// MT 09/2002: nExtraOffsetX should become a member, instead of checking every time,
// but I need an incompatible update for this...
// #94095# Use extra offset only when edit has a border
long nExtraOffset = 0;
if( ( GetStyle() & WB_BORDER ) || ( mbIsSubEdit && ( GetParent()->GetStyle() & WB_BORDER ) ) )
nExtraOffset = 2;
return nExtraOffset;
}
2000-09-18 16:07:07 +00:00
// -----------------------------------------------------------------------
XubString Edit::ImplGetText() const
{
if ( mcEchoChar || (GetStyle() & WB_PASSWORD) )
{
XubString aText;
xub_Unicode cEchoChar;
if ( mcEchoChar )
cEchoChar = mcEchoChar;
else
cEchoChar = '*';
aText.Fill( maText.Len(), cEchoChar );
return aText;
}
else
return maText;
}
// -----------------------------------------------------------------------
void Edit::ImplInvalidateOrRepaint( xub_StrLen nStart, xub_StrLen nEnd )
{
if( IsPaintTransparent() )
{
Invalidate();
// FIXME: this is currently only on aqua
if( ImplGetSVData()->maNWFData.mbNoFocusRects )
Update();
}
else
ImplRepaint( nStart, nEnd );
}
// -----------------------------------------------------------------------
long Edit::ImplGetTextYPosition() const
{
if ( GetStyle() & WB_TOP )
return ImplGetExtraOffset();
else if ( GetStyle() & WB_BOTTOM )
return GetOutputSizePixel().Height() - GetTextHeight() - ImplGetExtraOffset();
return ( GetOutputSizePixel().Height() - GetTextHeight() ) / 2;
}
// -----------------------------------------------------------------------
void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
2000-09-18 16:07:07 +00:00
{
if ( !IsReallyVisible() )
return;
XubString aText = ImplGetText();
2002-09-25 16:13:57 +00:00
nStart = 0;
nEnd = aText.Len();
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
sal_Int32* pDX = nDXBuffer;
if( aText.Len() )
2002-09-25 16:13:57 +00:00
{
if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
}
2002-09-25 16:13:57 +00:00
GetCaretPositions( aText, pDX, nStart, nEnd );
}
2000-09-18 16:07:07 +00:00
2002-09-25 16:13:57 +00:00
long nTH = GetTextHeight();
Point aPos( mnXOffset, ImplGetTextYPosition() );
2000-09-18 16:07:07 +00:00
2002-09-25 16:13:57 +00:00
if( bLayout )
{
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
MetricVector* pVector = &mpControlData->mpLayoutData->m_aUnicodeBoundRects;
String* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
2002-09-25 16:13:57 +00:00
DrawText( aPos, aText, nStart, nEnd - nStart, pVector, pDisplayText );
if( pDXBuffer )
2002-10-01 14:43:23 +00:00
delete [] pDXBuffer;
2002-09-25 16:13:57 +00:00
return;
}
2000-09-18 16:07:07 +00:00
Cursor* pCursor = GetCursor();
sal_Bool bVisCursor = pCursor ? pCursor->IsVisible() : sal_False;
2002-09-25 16:13:57 +00:00
if ( pCursor )
2000-09-18 16:07:07 +00:00
pCursor->Hide();
ImplClearBackground( 0, GetOutputSizePixel().Width() );
2000-09-18 16:07:07 +00:00
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsEnabled() )
ImplInitSettings( sal_False, sal_True, sal_False );
2000-09-18 16:07:07 +00:00
else
SetTextColor( rStyleSettings.GetDisableColor() );
// Set background color of the normal text
if( (GetStyle() & WB_FORCECTRLBACKGROUND) != 0 && IsControlBackground() )
{
// check if we need to set ControlBackground even in NWF case
Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
SetLineColor();
SetFillColor( GetControlBackground() );
DrawRect( Rectangle( aPos, Size( GetOutputSizePixel().Width() - 2*mnXOffset, nTH ) ) );
Pop();
SetTextFillColor( GetControlBackground() );
}
else if( IsPaintTransparent() || ImplUseNativeBorder( GetStyle() ) )
SetTextFillColor();
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
2000-09-18 16:07:07 +00:00
sal_Bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
2000-09-18 16:07:07 +00:00
2002-09-25 16:13:57 +00:00
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
2000-09-18 16:07:07 +00:00
if ( !bDrawSelection && !mpIMEInfos )
{
2002-09-25 16:13:57 +00:00
DrawText( aPos, aText, nStart, nEnd - nStart );
2000-09-18 16:07:07 +00:00
}
else
{
2002-09-25 16:13:57 +00:00
// save graphics state
Push();
// first calculate higlighted and non highlighted clip regions
Region aHiglightClipRegion;
Region aNormalClipRegion;
2000-09-18 16:07:07 +00:00
Selection aTmpSel( maSelection );
aTmpSel.Justify();
2002-09-25 16:13:57 +00:00
// selection is highlighted
int i;
for( i = 0; i < aText.Len(); i++ )
2000-09-18 16:07:07 +00:00
{
2002-09-25 16:13:57 +00:00
Rectangle aRect( aPos, Size( 10, nTH ) );
aRect.Left() = pDX[2*i] + mnXOffset + ImplGetExtraOffset();
aRect.Right() = pDX[2*i+1] + mnXOffset + ImplGetExtraOffset();
aRect.Justify();
bool bHighlight = false;
if( i >= aTmpSel.Min() && i < aTmpSel.Max() )
bHighlight = true;
if( mpIMEInfos && mpIMEInfos->pAttribs &&
i >= mpIMEInfos->nPos && i < (mpIMEInfos->nPos+mpIMEInfos->nLen ) &&
( mpIMEInfos->pAttribs[i-mpIMEInfos->nPos] & EXTTEXTINPUT_ATTR_HIGHLIGHT) )
bHighlight = true;
if( bHighlight )
aHiglightClipRegion.Union( aRect );
else
aNormalClipRegion.Union( aRect );
}
// draw normal text
2002-09-26 07:01:49 +00:00
Color aNormalTextColor = GetTextColor();
2002-09-25 16:13:57 +00:00
SetClipRegion( aNormalClipRegion );
if( IsPaintTransparent() )
SetTextFillColor();
else
{
// Set background color when part of the text is selected
if ( ImplUseNativeBorder( GetStyle() ) )
{
if( (GetStyle() & WB_FORCECTRLBACKGROUND) != 0 && IsControlBackground() )
SetTextFillColor( GetControlBackground() );
else
SetTextFillColor();
}
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
}
2002-09-25 16:13:57 +00:00
DrawText( aPos, aText, nStart, nEnd - nStart );
2002-09-25 16:13:57 +00:00
// draw highlighted text
SetClipRegion( aHiglightClipRegion );
SetTextColor( rStyleSettings.GetHighlightTextColor() );
SetTextFillColor( rStyleSettings.GetHighlightColor() );
DrawText( aPos, aText, nStart, nEnd - nStart );
2002-09-26 07:01:49 +00:00
2002-09-25 16:13:57 +00:00
// if IME info exists loop over portions and output different font attributes
if( mpIMEInfos && mpIMEInfos->pAttribs )
{
for( int n = 0; n < 2; n++ )
2000-09-18 16:07:07 +00:00
{
2002-09-25 16:13:57 +00:00
Region aRegion;
if( n == 0 )
2000-09-18 16:07:07 +00:00
{
2002-09-26 07:01:49 +00:00
SetTextColor( aNormalTextColor );
if( IsPaintTransparent() )
SetTextFillColor();
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
2002-09-26 07:01:49 +00:00
aRegion = aNormalClipRegion;
2000-09-18 16:07:07 +00:00
}
2002-09-25 16:13:57 +00:00
else
2000-09-18 16:07:07 +00:00
{
2002-09-26 07:01:49 +00:00
SetTextColor( rStyleSettings.GetHighlightTextColor() );
SetTextFillColor( rStyleSettings.GetHighlightColor() );
aRegion = aHiglightClipRegion;
2000-09-18 16:07:07 +00:00
}
2002-09-26 07:01:49 +00:00
for( i = 0; i < mpIMEInfos->nLen; )
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nAttr = mpIMEInfos->pAttribs[i];
2002-09-26 07:01:49 +00:00
Region aClip;
int nIndex = i;
while( nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it
2002-09-25 16:13:57 +00:00
{
2002-09-26 07:01:49 +00:00
Rectangle aRect( aPos, Size( 10, nTH ) );
aRect.Left() = pDX[2*(nIndex+mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraOffset();
aRect.Right() = pDX[2*(nIndex+mpIMEInfos->nPos)+1] + mnXOffset + ImplGetExtraOffset();
aRect.Justify();
aClip.Union( aRect );
nIndex++;
}
i = nIndex;
if( aClip.Intersect( aRegion ) && nAttr )
{
Font aFont = GetFont();
if ( nAttr & EXTTEXTINPUT_ATTR_UNDERLINE )
aFont.SetUnderline( UNDERLINE_SINGLE );
else if ( nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE )
aFont.SetUnderline( UNDERLINE_BOLD );
else if ( nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE )
aFont.SetUnderline( UNDERLINE_DOTTED );
else if ( nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE )
aFont.SetUnderline( UNDERLINE_DOTTED );
else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
2002-09-25 16:13:57 +00:00
{
2002-09-26 07:01:49 +00:00
aFont.SetUnderline( UNDERLINE_WAVE );
SetTextLineColor( Color( COL_LIGHTGRAY ) );
2002-09-25 16:13:57 +00:00
}
2002-09-26 07:01:49 +00:00
SetFont( aFont );
if ( nAttr & EXTTEXTINPUT_ATTR_REDTEXT )
SetTextColor( Color( COL_RED ) );
else if ( nAttr & EXTTEXTINPUT_ATTR_HALFTONETEXT )
SetTextColor( Color( COL_LIGHTGRAY ) );
2002-09-25 16:13:57 +00:00
SetClipRegion( aClip );
DrawText( aPos, aText, nStart, nEnd - nStart );
}
}
2000-09-18 16:07:07 +00:00
}
}
2002-09-25 16:13:57 +00:00
// restore graphics state
Pop();
2000-09-18 16:07:07 +00:00
}
2002-09-25 16:13:57 +00:00
if ( bVisCursor && ( !mpIMEInfos || mpIMEInfos->bCursor ) )
2000-09-18 16:07:07 +00:00
pCursor->Show();
2002-09-25 16:13:57 +00:00
if( pDXBuffer )
2002-10-01 14:43:23 +00:00
delete [] pDXBuffer;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode )
2000-09-18 16:07:07 +00:00
{
XubString aText = ImplGetText();
// loeschen moeglich?
if ( !rSelection.Len() &&
(((rSelection.Min() == 0) && (nDirection == EDIT_DEL_LEFT)) ||
((rSelection.Max() == aText.Len()) && (nDirection == EDIT_DEL_RIGHT))) )
return;
ImplClearLayoutData();
2000-09-18 16:07:07 +00:00
Selection aSelection( rSelection );
aSelection.Justify();
if ( !aSelection.Len() )
{
uno::Reference < i18n::XBreakIterator > xBI = ImplGetBreakIterator();
2000-09-18 16:07:07 +00:00
if ( nDirection == EDIT_DEL_LEFT )
{
if ( nMode == EDIT_DELMODE_RESTOFWORD )
{
2000-11-20 16:52:32 +00:00
i18n::Boundary aBoundary = xBI->getWordBoundary( maText, aSelection.Min(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
2000-09-18 16:07:07 +00:00
if ( aBoundary.startPos == aSelection.Min() )
2000-11-20 16:52:32 +00:00
aBoundary = xBI->previousWord( maText, aSelection.Min(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
2000-09-18 16:07:07 +00:00
aSelection.Min() = aBoundary.startPos;
}
else if ( nMode == EDIT_DELMODE_RESTOFCONTENT )
{
aSelection.Min() = 0;
}
else
{
sal_Int32 nCount = 1;
2000-11-20 16:52:32 +00:00
aSelection.Min() = xBI->previousCharacters( maText, aSelection.Min(), GetSettings().GetLocale(), i18n::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );
2000-09-18 16:07:07 +00:00
}
}
else
{
if ( nMode == EDIT_DELMODE_RESTOFWORD )
{
2000-11-20 16:52:32 +00:00
i18n::Boundary aBoundary = xBI->nextWord( maText, aSelection.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
2000-09-18 16:07:07 +00:00
aSelection.Max() = aBoundary.startPos;
}
else if ( nMode == EDIT_DELMODE_RESTOFCONTENT )
{
aSelection.Max() = aText.Len();
}
else
{
sal_Int32 nCount = 1;
2000-11-20 16:52:32 +00:00
aSelection.Max() = xBI->nextCharacters( maText, aSelection.Max(), GetSettings().GetLocale(), i18n::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );;
2000-09-18 16:07:07 +00:00
}
}
}
maText.Erase( (xub_StrLen)aSelection.Min(), (xub_StrLen)aSelection.Len() );
maSelection.Min() = aSelection.Min();
maSelection.Max() = aSelection.Min();
ImplAlignAndPaint();
mbInternModified = sal_True;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
String Edit::ImplGetValidString( const String& rString ) const
{
String aValidString( rString );
aValidString.EraseAllChars( _LF );
aValidString.EraseAllChars( _CR );
aValidString.SearchAndReplaceAll( '\t', ' ' );
return aValidString;
}
// -----------------------------------------------------------------------
uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
uno::Reference < i18n::XBreakIterator > xBI;
// if ( !xBI.is() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
Merge commit 'ooo/DEV300_m101' into intm101 The following builds for me: basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl, psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl The rest still needs fixing ;-) Conflicts: canvas/prj/build.lst canvas/source/cairo/cairo_textlayout.cxx canvas/source/directx/dx_winstuff.hxx canvas/source/tools/image.cxx canvas/source/vcl/canvashelper.cxx comphelper/inc/comphelper/documentconstants.hxx comphelper/inc/comphelper/optionalvalue.hxx comphelper/inc/comphelper/querydeep.hxx comphelper/prj/build.lst comphelper/qa/complex/makefile.mk comphelper/qa/string/test_string_noadditional.cxx comphelper/source/misc/componentmodule.cxx comphelper/source/misc/mimeconfighelper.cxx comphelper/source/misc/querydeep.cxx comphelper/source/misc/uieventslogger.cxx comphelper/source/property/TypeGeneration.cxx comphelper/test/uno_iterators/uno_iterators.cxx comphelper/util/makefile.mk cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/prj/build.lst dtrans/source/generic/dtrans.cxx dtrans/source/win32/dtobj/FmtFilter.cxx i18npool/prj/build.lst i18npool/source/localedata/data/localedata_others.map i18npool/source/localedata/data/makefile.mk i18npool/source/localedata/localedata.cxx i18npool/source/localedata/saxparser.cxx i18npool/source/registerservices/registerservices.cxx i18npool/source/search/textsearch.cxx l10ntools/inc/cfgmerge.hxx l10ntools/inc/export.hxx l10ntools/inc/gsicheck.hxx l10ntools/inc/l10ntools/vosapp.hxx l10ntools/inc/tagtest.hxx l10ntools/inc/xmlparse.hxx l10ntools/layout/layoutparse.cxx l10ntools/layout/tralay.cxx l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/export2.cxx l10ntools/source/gsicheck.cxx l10ntools/source/help/HelpLinker.cxx l10ntools/source/lngex.cxx l10ntools/source/lngmerge.cxx l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx padmin/source/fontentry.cxx padmin/source/padialog.cxx padmin/source/padialog.src padmin/source/pamain.cxx rsc/inc/rscarray.hxx rsc/inc/rscclass.hxx rsc/inc/rscclobj.hxx rsc/inc/rsccont.hxx rsc/inc/rscdb.hxx rsc/inc/rscdef.hxx rsc/inc/rscmgr.hxx rsc/inc/rscrange.hxx rsc/inc/rsctop.hxx rsc/inc/vclrsc.hxx rsc/source/parser/rscdb.cxx rsc/source/parser/rscicpx.cxx rsc/source/parser/rscinit.cxx rsc/source/prj/start.cxx rsc/source/res/rscarray.cxx rsc/source/res/rscclass.cxx rsc/source/res/rscclobj.cxx rsc/source/res/rsccont.cxx rsc/source/res/rscmgr.cxx rsc/source/res/rscrange.cxx rsc/source/res/rsctop.cxx rsc/source/rsc/rsc.cxx rsc/source/tools/rscdef.cxx rsc/source/tools/rsctools.cxx sax/source/expatwrap/sax_expat.cxx sax/source/fastparser/facreg.cxx sax/source/tools/fastserializer.cxx sot/inc/sot/filelist.hxx sot/inc/sot/object.hxx sot/source/base/factory.cxx sot/source/base/filelist.cxx sot/source/sdstor/stg.cxx sot/source/sdstor/stgcache.cxx sot/source/sdstor/stgole.cxx sot/source/sdstor/stgstrms.cxx sot/source/sdstor/storage.cxx sot/source/sdstor/ucbstorage.cxx svl/inc/svl/cenumitm.hxx svl/inc/svl/cintitem.hxx svl/inc/svl/cntwall.hxx svl/inc/svl/ctypeitm.hxx svl/inc/svl/custritm.hxx svl/inc/svl/dateitem.hxx svl/inc/svl/filerec.hxx svl/inc/svl/globalnameitem.hxx svl/inc/svl/ilstitem.hxx svl/inc/svl/imageitm.hxx svl/inc/svl/intitem.hxx svl/inc/svl/itempool.hxx svl/inc/svl/itemset.hxx svl/inc/svl/lckbitem.hxx svl/inc/svl/poolitem.hxx svl/inc/svl/ptitem.hxx svl/inc/svl/rectitem.hxx svl/inc/svl/sfontitm.hxx svl/inc/svl/slstitm.hxx svl/inc/svl/srchitem.hxx svl/inc/svl/svarray.hxx svl/inc/svl/svdde.hxx svl/inc/svl/svstdarr.hxx svl/inc/svl/szitem.hxx svl/inc/svl/visitem.hxx svl/inc/svl/zforlist.hxx svl/inc/svl/zformat.hxx svl/prj/build.lst svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx svl/qa/complex/ConfigItems/helper/makefile.mk svl/qa/makefile.mk svl/source/filepicker/pickerhelper.cxx svl/source/filerec/filerec.cxx svl/source/items/cenumitm.cxx svl/source/items/cintitem.cxx svl/source/items/cntwall.cxx svl/source/items/ctypeitm.cxx svl/source/items/custritm.cxx svl/source/items/dateitem.cxx svl/source/items/globalnameitem.cxx svl/source/items/ilstitem.cxx svl/source/items/imageitm.cxx svl/source/items/intitem.cxx svl/source/items/itempool.cxx svl/source/items/itemprop.cxx svl/source/items/itemset.cxx svl/source/items/lckbitem.cxx svl/source/items/poolio.cxx svl/source/items/poolitem.cxx svl/source/items/ptitem.cxx svl/source/items/rectitem.cxx svl/source/items/slstitm.cxx svl/source/items/srchitem.cxx svl/source/items/style.cxx svl/source/items/szitem.cxx svl/source/items/visitem.cxx svl/source/items/whiter.cxx svl/source/memtools/svarray.cxx svl/source/misc/PasswordHelper.cxx svl/source/misc/adrparse.cxx svl/source/misc/lngmisc.cxx svl/source/notify/brdcst.cxx svl/source/notify/listener.cxx svl/source/notify/listenerbase.cxx svl/source/numbers/makefile.mk svl/source/numbers/nbdll.cxx svl/source/numbers/zforfind.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svl/source/passwordcontainer/passwordcontainer.cxx svl/source/svdde/ddecli.cxx svl/source/svdde/ddeimp.hxx svl/source/svdde/ddemlos2.h svl/source/svdde/ddesvr.cxx svl/source/undo/undo.cxx svl/source/uno/registerservices.cxx svl/util/makefile.mk svtools/bmpmaker/bmpsum.cxx svtools/bmpmaker/g2g.cxx svtools/bmpmaker/makefile.mk svtools/inc/borderhelper.hxx svtools/inc/svtools/accessiblefactory.hxx svtools/inc/svtools/apearcfg.hxx svtools/inc/svtools/brwbox.hxx svtools/inc/svtools/ctrlbox.hxx svtools/inc/svtools/ctrltool.hxx svtools/inc/svtools/editbrowsebox.hxx svtools/inc/svtools/ehdl.hxx svtools/inc/svtools/embedhlp.hxx svtools/inc/svtools/filter.hxx svtools/inc/svtools/ivctrl.hxx svtools/inc/svtools/parhtml.hxx svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/rtftoken.h svtools/inc/svtools/ruler.hxx svtools/inc/svtools/svicnvw.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svlbox.hxx svtools/inc/svtools/svtreebx.hxx svtools/inc/svtools/tabbar.hxx svtools/inc/svtools/table/abstracttablecontrol.hxx svtools/inc/svtools/taskbar.hxx svtools/inc/svtools/textview.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/datwin.cxx svtools/source/brwbox/datwin.hxx svtools/source/brwbox/makefile.mk svtools/source/config/apearcfg.cxx svtools/source/config/htmlcfg.cxx svtools/source/config/menuoptions.cxx svtools/source/config/miscopt.cxx svtools/source/contnr/cont_pch.cxx svtools/source/contnr/ctrdll.cxx svtools/source/contnr/fileview.cxx svtools/source/contnr/imivctl1.cxx svtools/source/contnr/ivctrl.cxx svtools/source/contnr/makefile.mk svtools/source/contnr/svcontnr.src svtools/source/contnr/svicnvw.cxx svtools/source/contnr/svimpbox.cxx svtools/source/contnr/svimpicn.cxx svtools/source/contnr/svlbitm.cxx svtools/source/contnr/svtreebx.cxx svtools/source/contnr/templwin.cxx svtools/source/contnr/templwin.hxx svtools/source/control/asynclink.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrldll.cxx svtools/source/control/ctrltool.cxx svtools/source/control/filectrl.cxx svtools/source/control/filectrl.src svtools/source/control/headbar.cxx svtools/source/control/inettbc.cxx svtools/source/control/makefile.mk svtools/source/control/prgsbar.cxx svtools/source/control/roadmap.cxx svtools/source/control/ruler.cxx svtools/source/control/scriptedtext.cxx svtools/source/control/stdmenu.cxx svtools/source/control/tabbar.cxx svtools/source/control/taskbar.cxx svtools/source/control/taskbox.cxx svtools/source/control/taskmisc.cxx svtools/source/control/taskstat.cxx svtools/source/control/valueacc.cxx svtools/source/control/valueset.cxx svtools/source/dialogs/addresstemplate.cxx svtools/source/dialogs/addresstemplate.src svtools/source/dialogs/colrdlg.src svtools/source/dialogs/filedlg2.cxx svtools/source/dialogs/filedlg2.hxx svtools/source/dialogs/makefile.mk svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.src svtools/source/dialogs/propctrl.cxx svtools/source/dialogs/propctrl.hxx svtools/source/dialogs/property.cxx svtools/source/edit/makefile.mk svtools/source/edit/sychconv.cxx svtools/source/edit/syntaxhighlight.cxx svtools/source/edit/textdoc.cxx svtools/source/edit/texteng.cxx svtools/source/edit/textundo.cxx svtools/source/edit/textview.cxx svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx svtools/source/filter.vcl/filter/dlgejpg.cxx svtools/source/filter.vcl/filter/dlgejpg.hxx svtools/source/filter.vcl/filter/dlgejpg.src svtools/source/filter.vcl/filter/dlgepng.cxx svtools/source/filter.vcl/filter/dlgepng.hxx svtools/source/filter.vcl/filter/dlgepng.src svtools/source/filter.vcl/filter/dlgexpor.cxx svtools/source/filter.vcl/filter/dlgexpor.hxx svtools/source/filter.vcl/filter/dlgexpor.src svtools/source/filter.vcl/filter/filter2.cxx svtools/source/filter.vcl/filter/makefile.mk svtools/source/filter.vcl/filter/sgfbram.cxx svtools/source/filter.vcl/filter/sgvmain.cxx svtools/source/filter.vcl/filter/sgvspln.cxx svtools/source/filter.vcl/filter/strings.src svtools/source/filter.vcl/jpeg/makefile.mk svtools/source/filter.vcl/wmf/emfwr.cxx svtools/source/filter.vcl/wmf/emfwr.hxx svtools/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.hxx svtools/source/graphic/grfcache.cxx svtools/source/graphic/grfcache.hxx svtools/source/graphic/grfmgr.cxx svtools/source/graphic/makefile.mk svtools/source/inc/accessibletableimp.hxx svtools/source/inc/svimpbox.hxx svtools/source/java/patchjavaerror.src svtools/source/misc/ehdl.cxx svtools/source/misc/errtxt.src svtools/source/misc/helpagentwindow.cxx svtools/source/misc/imagemgr.cxx svtools/source/misc/imagemgr.src svtools/source/misc/imageresourceaccess.cxx svtools/source/misc/imap.cxx svtools/source/misc/langtab.src svtools/source/misc/makefile.mk svtools/source/misc/svtdata.cxx svtools/source/misc/templatefoldercache.cxx svtools/source/misc/transfer2.cxx svtools/source/misc/undo.src svtools/source/plugapp/commtest.cxx svtools/source/plugapp/commtest.src svtools/source/plugapp/makefile.mk svtools/source/plugapp/testtool.src svtools/source/productregistration/productregistration.cxx svtools/source/svhtml/htmlkywd.cxx svtools/source/svhtml/parhtml.cxx svtools/source/svrtf/rtfkey2.cxx svtools/source/svrtf/rtfkeywd.cxx svtools/source/table/defaultinputhandler.cxx svtools/source/table/makefile.mk svtools/source/table/tablecontrol.cxx svtools/source/table/tablecontrol_impl.cxx svtools/source/table/tablecontrol_impl.hxx svtools/source/table/tabledatawindow.cxx svtools/source/table/tablegeometry.cxx svtools/source/table/tablegeometry.hxx svtools/source/toolpanel/makefile.mk svtools/source/toolpanel/toolpaneldrawer.cxx svtools/source/uno/addrtempuno.cxx svtools/source/uno/miscservices.cxx svtools/source/uno/svtxgridcontrol.cxx svtools/source/uno/svtxgridcontrol.hxx svtools/source/uno/toolboxcontroller.cxx svtools/source/uno/treecontrolpeer.cxx svtools/source/uno/unocontroltablemodel.cxx svtools/source/uno/unocontroltablemodel.hxx svtools/source/uno/unoimap.cxx svtools/source/urlobj/inetimg.cxx svtools/util/makefile.mk svtools/workben/browser.cxx svtools/workben/cui/makefile.mk svtools/workben/makefile.mk svtools/workben/stest.cxx svtools/workben/toolpanel/makefile.mk svtools/workben/urange.cxx toolkit/inc/toolkit/awt/vclxdevice.hxx toolkit/inc/toolkit/awt/vclxgraphics.hxx toolkit/inc/toolkit/awt/vclxwindows.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/servicenames.hxx toolkit/inc/toolkit/helper/throbberimpl.hxx toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java toolkit/source/awt/asynccallback.cxx toolkit/source/awt/vclxgraphics.cxx toolkit/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/xsimpleanimation.cxx toolkit/source/awt/xthrobber.cxx toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/grid/defaultgridcolumnmodel.cxx toolkit/source/controls/grid/defaultgriddatamodel.cxx toolkit/source/controls/grid/gridcontrol.cxx toolkit/source/controls/grid/initguard.hxx toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrolcontainer.cxx toolkit/source/controls/unocontrols.cxx toolkit/source/helper/listenermultiplexer.cxx toolkit/source/helper/property.cxx toolkit/source/helper/registerservices.cxx toolkit/source/helper/servicenames.cxx toolkit/source/helper/throbberimpl.cxx toolkit/source/helper/tkresmgr.cxx tools/StaticLibrary_ooopathutils.mk tools/bootstrp/addexes/makefile.mk tools/bootstrp/addexes2/makefile.mk tools/bootstrp/addexes2/mkfilt.cxx tools/bootstrp/command.cxx tools/bootstrp/cppdep.cxx tools/bootstrp/iserver.cxx tools/bootstrp/makefile.mk tools/bootstrp/mkcreate.cxx tools/bootstrp/prj.cxx tools/bootstrp/rscdep.cxx tools/bootstrp/sstring.cxx tools/inc/bootstrp/command.hxx tools/inc/bootstrp/mkcreate.hxx tools/inc/bootstrp/prj.hxx tools/inc/bootstrp/sstring.hxx tools/inc/tools/agapi.hxx tools/inc/tools/agitem.hxx tools/inc/tools/chapi.hxx tools/inc/tools/download.hxx tools/inc/tools/eacopier.hxx tools/inc/tools/fract.hxx tools/inc/tools/fsys.hxx tools/inc/tools/geninfo.hxx tools/inc/tools/globname.hxx tools/inc/tools/inetmime.hxx tools/inc/tools/multisel.hxx tools/inc/tools/poly.hxx tools/inc/tools/postsys.h tools/inc/tools/postwin.h tools/inc/tools/presys.h tools/inc/tools/prewin.h tools/inc/tools/pstm.hxx tools/inc/tools/ref.hxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/inc/tools/table.hxx tools/inc/tools/urlkeys.hxx tools/inc/tools/urlobj.hxx tools/prj/build.lst tools/prj/d.lst tools/qa/makefile.mk tools/source/communi/geninfo.cxx tools/source/debug/debug.cxx tools/source/fsys/dirent.cxx tools/source/fsys/tdir.cxx tools/source/fsys/unx.cxx tools/source/fsys/urlobj.cxx tools/source/generic/color.cxx tools/source/generic/config.cxx tools/source/generic/fract.cxx tools/source/inet/inetmime.cxx tools/source/memtools/multisel.cxx tools/source/memtools/table.cxx tools/source/rc/resmgr.cxx tools/source/ref/globname.cxx tools/source/ref/pstm.cxx tools/source/solar/solar.c tools/source/stream/strmos2.cxx tools/source/stream/strmunx.cxx tools/source/stream/strmwnt.cxx tools/source/string/makefile.mk tools/source/testtoolloader/testtoolloader.cxx tools/test/makefile.mk tools/util/makefile.mk tools/win/inc/dll.hxx tools/win/inc/parser.hxx tools/win/inc/shellex.h tools/win/inc/shutil.h tools/win/inc/toolsdll.hxx tools/win/inc/winshell.hxx tools/workben/makefile.mk ucbhelper/source/client/proxydecider.cxx ucbhelper/workben/ucbexplorer/ucbexplorer.hrc unotools/inc/unotools/unotunnelhelper.hxx unotools/source/config/fltrcfg.cxx unotools/source/config/lingucfg.cxx unotools/source/config/misccfg.cxx unotools/source/config/pathoptions.cxx unotools/source/config/searchopt.cxx unotools/source/i18n/localedatawrapper.cxx unotools/source/ucbhelper/localfilehelper.cxx unotools/source/ucbhelper/ucbhelper.cxx unotools/source/ucbhelper/xtempfile.cxx vcl/aqua/inc/salbmp.h vcl/aqua/inc/salgdi.h vcl/aqua/inc/salinst.h vcl/aqua/source/app/salinst.cxx vcl/aqua/source/gdi/aquaprintaccessoryview.mm vcl/aqua/source/gdi/salgdi.cxx vcl/aqua/source/gdi/salprn.cxx vcl/aqua/source/window/salframeview.mm vcl/aqua/source/window/salobj.cxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/brdwin.hxx vcl/inc/vcl/button.hxx vcl/inc/vcl/cmdevt.hxx vcl/inc/vcl/cvtgrf.hxx vcl/inc/vcl/dialog.hxx vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/event.hxx vcl/inc/vcl/fixed.hxx vcl/inc/vcl/fldunit.hxx vcl/inc/vcl/floatwin.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/ilstbox.hxx vcl/inc/vcl/image.h vcl/inc/vcl/imgctrl.hxx vcl/inc/vcl/impbmpconv.hxx vcl/inc/vcl/impprn.hxx vcl/inc/vcl/jobset.h vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/mapunit.hxx vcl/inc/vcl/menu.hxx vcl/inc/vcl/msgbox.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/prndlg.hxx vcl/inc/vcl/salatype.hxx vcl/inc/vcl/salbmp.hxx vcl/inc/vcl/salgdi.hxx vcl/inc/vcl/salinst.hxx vcl/inc/vcl/seleng.hxx vcl/inc/vcl/settings.hxx vcl/inc/vcl/smartid.hxx vcl/inc/vcl/status.hxx vcl/inc/vcl/strhelper.hxx vcl/inc/vcl/svapp.hxx vcl/inc/vcl/svdata.hxx vcl/inc/vcl/syschild.hxx vcl/inc/vcl/sysdata.hxx vcl/inc/vcl/taskpanelist.hxx vcl/inc/vcl/toolbox.hxx vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/windata.hxx vcl/inc/vcl/window.hxx vcl/inc/vcl/wintypes.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/gdi/salgdi.cxx vcl/os2/source/window/salmenu.cxx vcl/os2/source/window/salobj.cxx vcl/prj/build.lst vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/svapp.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/app/svmainhook.cxx vcl/source/app/unohelp.cxx vcl/source/app/vclevent.cxx vcl/source/control/button.cxx vcl/source/control/combobox.cxx vcl/source/control/edit.cxx vcl/source/control/field.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/imgctrl.cxx vcl/source/control/makefile.mk vcl/source/control/tabctrl.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmap4.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/font.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/image.cxx vcl/source/gdi/impimage.cxx vcl/source/gdi/jobset.cxx vcl/source/gdi/makefile.mk vcl/source/gdi/metaact.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdevnative.cxx vcl/source/gdi/pdfwriter.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/print3.cxx vcl/source/gdi/salmisc.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_textsrc.hxx vcl/source/helper/canvasbitmap.cxx vcl/source/helper/smartid.cxx vcl/source/helper/xconnection.cxx vcl/source/src/btntext.src vcl/source/src/images.src vcl/source/src/print.src vcl/source/window/accel.cxx vcl/source/window/accmgr.cxx vcl/source/window/brdwin.cxx vcl/source/window/btndlg.cxx vcl/source/window/dlgctrl.cxx vcl/source/window/javachild.cxx vcl/source/window/menu.cxx vcl/source/window/msgbox.cxx vcl/source/window/printdlg.cxx vcl/source/window/status.cxx vcl/source/window/syschild.cxx vcl/source/window/toolbox.cxx vcl/source/window/toolbox2.cxx vcl/source/window/window.cxx vcl/source/window/window2.cxx vcl/source/window/wrkwin.cxx vcl/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkinst.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkobject.cxx vcl/unx/headless/svpbmp.hxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svpinst.cxx vcl/unx/headless/svpinst.hxx vcl/unx/headless/svpprn.cxx vcl/unx/headless/svpprn.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/unx/headless/svptext.cxx vcl/unx/inc/dtint.hxx vcl/unx/inc/plugins/gtk/gtkdata.hxx vcl/unx/inc/pspgraphics.h vcl/unx/inc/salbmp.h vcl/unx/inc/saldata.hxx vcl/unx/inc/saldisp.hxx vcl/unx/inc/salgdi.h vcl/unx/inc/salinst.h vcl/unx/inc/xfont.hxx vcl/unx/kde/kdedata.cxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/source/app/keysymnames.cxx vcl/unx/source/app/saldata.cxx vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/salinst.cxx vcl/unx/source/app/wmadaptor.cxx vcl/unx/source/dtrans/X11_selection.cxx vcl/unx/source/dtrans/X11_service.cxx vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/salgdi.cxx vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salprnpsp.cxx vcl/unx/source/gdi/xfont.cxx vcl/unx/source/gdi/xlfd_attr.cxx vcl/unx/source/gdi/xlfd_attr.hxx vcl/unx/source/gdi/xlfd_extd.cxx vcl/unx/source/gdi/xlfd_extd.hxx vcl/unx/source/gdi/xlfd_smpl.cxx vcl/unx/source/gdi/xlfd_smpl.hxx vcl/unx/source/printer/ppdparser.cxx vcl/unx/source/printer/printerinfomanager.cxx vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salmenu.cxx vcl/unx/source/window/salobj.cxx vcl/util/makefile2.pmk vcl/win/inc/salbmp.h vcl/win/inc/saldata.hxx vcl/win/inc/salgdi.h vcl/win/inc/salinst.h vcl/win/source/app/saldata.cxx vcl/win/source/app/salinst.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salprn.cxx vcl/win/source/gdi/winlayout.cxx vcl/win/source/window/salframe.cxx vcl/win/source/window/salobj.cxx vcl/workben/outdevgrind.cxx vos/inc/vos/execabl.hxx vos/inc/vos/macros.hxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/refernce.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/stream.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/process.cxx vos/source/signal.cxx vos/source/thread.cxx vos/source/timer.cxx
2011-03-11 14:24:23 +01:00
uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
if ( xI.is() )
{
Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
x >>= xBI;
}
}
return xBI;
}
// -----------------------------------------------------------------------
uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
// if ( !xISC.is() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
Merge commit 'ooo/DEV300_m101' into intm101 The following builds for me: basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl, psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl The rest still needs fixing ;-) Conflicts: canvas/prj/build.lst canvas/source/cairo/cairo_textlayout.cxx canvas/source/directx/dx_winstuff.hxx canvas/source/tools/image.cxx canvas/source/vcl/canvashelper.cxx comphelper/inc/comphelper/documentconstants.hxx comphelper/inc/comphelper/optionalvalue.hxx comphelper/inc/comphelper/querydeep.hxx comphelper/prj/build.lst comphelper/qa/complex/makefile.mk comphelper/qa/string/test_string_noadditional.cxx comphelper/source/misc/componentmodule.cxx comphelper/source/misc/mimeconfighelper.cxx comphelper/source/misc/querydeep.cxx comphelper/source/misc/uieventslogger.cxx comphelper/source/property/TypeGeneration.cxx comphelper/test/uno_iterators/uno_iterators.cxx comphelper/util/makefile.mk cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/prj/build.lst dtrans/source/generic/dtrans.cxx dtrans/source/win32/dtobj/FmtFilter.cxx i18npool/prj/build.lst i18npool/source/localedata/data/localedata_others.map i18npool/source/localedata/data/makefile.mk i18npool/source/localedata/localedata.cxx i18npool/source/localedata/saxparser.cxx i18npool/source/registerservices/registerservices.cxx i18npool/source/search/textsearch.cxx l10ntools/inc/cfgmerge.hxx l10ntools/inc/export.hxx l10ntools/inc/gsicheck.hxx l10ntools/inc/l10ntools/vosapp.hxx l10ntools/inc/tagtest.hxx l10ntools/inc/xmlparse.hxx l10ntools/layout/layoutparse.cxx l10ntools/layout/tralay.cxx l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/export2.cxx l10ntools/source/gsicheck.cxx l10ntools/source/help/HelpLinker.cxx l10ntools/source/lngex.cxx l10ntools/source/lngmerge.cxx l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx padmin/source/fontentry.cxx padmin/source/padialog.cxx padmin/source/padialog.src padmin/source/pamain.cxx rsc/inc/rscarray.hxx rsc/inc/rscclass.hxx rsc/inc/rscclobj.hxx rsc/inc/rsccont.hxx rsc/inc/rscdb.hxx rsc/inc/rscdef.hxx rsc/inc/rscmgr.hxx rsc/inc/rscrange.hxx rsc/inc/rsctop.hxx rsc/inc/vclrsc.hxx rsc/source/parser/rscdb.cxx rsc/source/parser/rscicpx.cxx rsc/source/parser/rscinit.cxx rsc/source/prj/start.cxx rsc/source/res/rscarray.cxx rsc/source/res/rscclass.cxx rsc/source/res/rscclobj.cxx rsc/source/res/rsccont.cxx rsc/source/res/rscmgr.cxx rsc/source/res/rscrange.cxx rsc/source/res/rsctop.cxx rsc/source/rsc/rsc.cxx rsc/source/tools/rscdef.cxx rsc/source/tools/rsctools.cxx sax/source/expatwrap/sax_expat.cxx sax/source/fastparser/facreg.cxx sax/source/tools/fastserializer.cxx sot/inc/sot/filelist.hxx sot/inc/sot/object.hxx sot/source/base/factory.cxx sot/source/base/filelist.cxx sot/source/sdstor/stg.cxx sot/source/sdstor/stgcache.cxx sot/source/sdstor/stgole.cxx sot/source/sdstor/stgstrms.cxx sot/source/sdstor/storage.cxx sot/source/sdstor/ucbstorage.cxx svl/inc/svl/cenumitm.hxx svl/inc/svl/cintitem.hxx svl/inc/svl/cntwall.hxx svl/inc/svl/ctypeitm.hxx svl/inc/svl/custritm.hxx svl/inc/svl/dateitem.hxx svl/inc/svl/filerec.hxx svl/inc/svl/globalnameitem.hxx svl/inc/svl/ilstitem.hxx svl/inc/svl/imageitm.hxx svl/inc/svl/intitem.hxx svl/inc/svl/itempool.hxx svl/inc/svl/itemset.hxx svl/inc/svl/lckbitem.hxx svl/inc/svl/poolitem.hxx svl/inc/svl/ptitem.hxx svl/inc/svl/rectitem.hxx svl/inc/svl/sfontitm.hxx svl/inc/svl/slstitm.hxx svl/inc/svl/srchitem.hxx svl/inc/svl/svarray.hxx svl/inc/svl/svdde.hxx svl/inc/svl/svstdarr.hxx svl/inc/svl/szitem.hxx svl/inc/svl/visitem.hxx svl/inc/svl/zforlist.hxx svl/inc/svl/zformat.hxx svl/prj/build.lst svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx svl/qa/complex/ConfigItems/helper/makefile.mk svl/qa/makefile.mk svl/source/filepicker/pickerhelper.cxx svl/source/filerec/filerec.cxx svl/source/items/cenumitm.cxx svl/source/items/cintitem.cxx svl/source/items/cntwall.cxx svl/source/items/ctypeitm.cxx svl/source/items/custritm.cxx svl/source/items/dateitem.cxx svl/source/items/globalnameitem.cxx svl/source/items/ilstitem.cxx svl/source/items/imageitm.cxx svl/source/items/intitem.cxx svl/source/items/itempool.cxx svl/source/items/itemprop.cxx svl/source/items/itemset.cxx svl/source/items/lckbitem.cxx svl/source/items/poolio.cxx svl/source/items/poolitem.cxx svl/source/items/ptitem.cxx svl/source/items/rectitem.cxx svl/source/items/slstitm.cxx svl/source/items/srchitem.cxx svl/source/items/style.cxx svl/source/items/szitem.cxx svl/source/items/visitem.cxx svl/source/items/whiter.cxx svl/source/memtools/svarray.cxx svl/source/misc/PasswordHelper.cxx svl/source/misc/adrparse.cxx svl/source/misc/lngmisc.cxx svl/source/notify/brdcst.cxx svl/source/notify/listener.cxx svl/source/notify/listenerbase.cxx svl/source/numbers/makefile.mk svl/source/numbers/nbdll.cxx svl/source/numbers/zforfind.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svl/source/passwordcontainer/passwordcontainer.cxx svl/source/svdde/ddecli.cxx svl/source/svdde/ddeimp.hxx svl/source/svdde/ddemlos2.h svl/source/svdde/ddesvr.cxx svl/source/undo/undo.cxx svl/source/uno/registerservices.cxx svl/util/makefile.mk svtools/bmpmaker/bmpsum.cxx svtools/bmpmaker/g2g.cxx svtools/bmpmaker/makefile.mk svtools/inc/borderhelper.hxx svtools/inc/svtools/accessiblefactory.hxx svtools/inc/svtools/apearcfg.hxx svtools/inc/svtools/brwbox.hxx svtools/inc/svtools/ctrlbox.hxx svtools/inc/svtools/ctrltool.hxx svtools/inc/svtools/editbrowsebox.hxx svtools/inc/svtools/ehdl.hxx svtools/inc/svtools/embedhlp.hxx svtools/inc/svtools/filter.hxx svtools/inc/svtools/ivctrl.hxx svtools/inc/svtools/parhtml.hxx svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/rtftoken.h svtools/inc/svtools/ruler.hxx svtools/inc/svtools/svicnvw.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svlbox.hxx svtools/inc/svtools/svtreebx.hxx svtools/inc/svtools/tabbar.hxx svtools/inc/svtools/table/abstracttablecontrol.hxx svtools/inc/svtools/taskbar.hxx svtools/inc/svtools/textview.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/datwin.cxx svtools/source/brwbox/datwin.hxx svtools/source/brwbox/makefile.mk svtools/source/config/apearcfg.cxx svtools/source/config/htmlcfg.cxx svtools/source/config/menuoptions.cxx svtools/source/config/miscopt.cxx svtools/source/contnr/cont_pch.cxx svtools/source/contnr/ctrdll.cxx svtools/source/contnr/fileview.cxx svtools/source/contnr/imivctl1.cxx svtools/source/contnr/ivctrl.cxx svtools/source/contnr/makefile.mk svtools/source/contnr/svcontnr.src svtools/source/contnr/svicnvw.cxx svtools/source/contnr/svimpbox.cxx svtools/source/contnr/svimpicn.cxx svtools/source/contnr/svlbitm.cxx svtools/source/contnr/svtreebx.cxx svtools/source/contnr/templwin.cxx svtools/source/contnr/templwin.hxx svtools/source/control/asynclink.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrldll.cxx svtools/source/control/ctrltool.cxx svtools/source/control/filectrl.cxx svtools/source/control/filectrl.src svtools/source/control/headbar.cxx svtools/source/control/inettbc.cxx svtools/source/control/makefile.mk svtools/source/control/prgsbar.cxx svtools/source/control/roadmap.cxx svtools/source/control/ruler.cxx svtools/source/control/scriptedtext.cxx svtools/source/control/stdmenu.cxx svtools/source/control/tabbar.cxx svtools/source/control/taskbar.cxx svtools/source/control/taskbox.cxx svtools/source/control/taskmisc.cxx svtools/source/control/taskstat.cxx svtools/source/control/valueacc.cxx svtools/source/control/valueset.cxx svtools/source/dialogs/addresstemplate.cxx svtools/source/dialogs/addresstemplate.src svtools/source/dialogs/colrdlg.src svtools/source/dialogs/filedlg2.cxx svtools/source/dialogs/filedlg2.hxx svtools/source/dialogs/makefile.mk svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.src svtools/source/dialogs/propctrl.cxx svtools/source/dialogs/propctrl.hxx svtools/source/dialogs/property.cxx svtools/source/edit/makefile.mk svtools/source/edit/sychconv.cxx svtools/source/edit/syntaxhighlight.cxx svtools/source/edit/textdoc.cxx svtools/source/edit/texteng.cxx svtools/source/edit/textundo.cxx svtools/source/edit/textview.cxx svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx svtools/source/filter.vcl/filter/dlgejpg.cxx svtools/source/filter.vcl/filter/dlgejpg.hxx svtools/source/filter.vcl/filter/dlgejpg.src svtools/source/filter.vcl/filter/dlgepng.cxx svtools/source/filter.vcl/filter/dlgepng.hxx svtools/source/filter.vcl/filter/dlgepng.src svtools/source/filter.vcl/filter/dlgexpor.cxx svtools/source/filter.vcl/filter/dlgexpor.hxx svtools/source/filter.vcl/filter/dlgexpor.src svtools/source/filter.vcl/filter/filter2.cxx svtools/source/filter.vcl/filter/makefile.mk svtools/source/filter.vcl/filter/sgfbram.cxx svtools/source/filter.vcl/filter/sgvmain.cxx svtools/source/filter.vcl/filter/sgvspln.cxx svtools/source/filter.vcl/filter/strings.src svtools/source/filter.vcl/jpeg/makefile.mk svtools/source/filter.vcl/wmf/emfwr.cxx svtools/source/filter.vcl/wmf/emfwr.hxx svtools/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.hxx svtools/source/graphic/grfcache.cxx svtools/source/graphic/grfcache.hxx svtools/source/graphic/grfmgr.cxx svtools/source/graphic/makefile.mk svtools/source/inc/accessibletableimp.hxx svtools/source/inc/svimpbox.hxx svtools/source/java/patchjavaerror.src svtools/source/misc/ehdl.cxx svtools/source/misc/errtxt.src svtools/source/misc/helpagentwindow.cxx svtools/source/misc/imagemgr.cxx svtools/source/misc/imagemgr.src svtools/source/misc/imageresourceaccess.cxx svtools/source/misc/imap.cxx svtools/source/misc/langtab.src svtools/source/misc/makefile.mk svtools/source/misc/svtdata.cxx svtools/source/misc/templatefoldercache.cxx svtools/source/misc/transfer2.cxx svtools/source/misc/undo.src svtools/source/plugapp/commtest.cxx svtools/source/plugapp/commtest.src svtools/source/plugapp/makefile.mk svtools/source/plugapp/testtool.src svtools/source/productregistration/productregistration.cxx svtools/source/svhtml/htmlkywd.cxx svtools/source/svhtml/parhtml.cxx svtools/source/svrtf/rtfkey2.cxx svtools/source/svrtf/rtfkeywd.cxx svtools/source/table/defaultinputhandler.cxx svtools/source/table/makefile.mk svtools/source/table/tablecontrol.cxx svtools/source/table/tablecontrol_impl.cxx svtools/source/table/tablecontrol_impl.hxx svtools/source/table/tabledatawindow.cxx svtools/source/table/tablegeometry.cxx svtools/source/table/tablegeometry.hxx svtools/source/toolpanel/makefile.mk svtools/source/toolpanel/toolpaneldrawer.cxx svtools/source/uno/addrtempuno.cxx svtools/source/uno/miscservices.cxx svtools/source/uno/svtxgridcontrol.cxx svtools/source/uno/svtxgridcontrol.hxx svtools/source/uno/toolboxcontroller.cxx svtools/source/uno/treecontrolpeer.cxx svtools/source/uno/unocontroltablemodel.cxx svtools/source/uno/unocontroltablemodel.hxx svtools/source/uno/unoimap.cxx svtools/source/urlobj/inetimg.cxx svtools/util/makefile.mk svtools/workben/browser.cxx svtools/workben/cui/makefile.mk svtools/workben/makefile.mk svtools/workben/stest.cxx svtools/workben/toolpanel/makefile.mk svtools/workben/urange.cxx toolkit/inc/toolkit/awt/vclxdevice.hxx toolkit/inc/toolkit/awt/vclxgraphics.hxx toolkit/inc/toolkit/awt/vclxwindows.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/servicenames.hxx toolkit/inc/toolkit/helper/throbberimpl.hxx toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java toolkit/source/awt/asynccallback.cxx toolkit/source/awt/vclxgraphics.cxx toolkit/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/xsimpleanimation.cxx toolkit/source/awt/xthrobber.cxx toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/grid/defaultgridcolumnmodel.cxx toolkit/source/controls/grid/defaultgriddatamodel.cxx toolkit/source/controls/grid/gridcontrol.cxx toolkit/source/controls/grid/initguard.hxx toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrolcontainer.cxx toolkit/source/controls/unocontrols.cxx toolkit/source/helper/listenermultiplexer.cxx toolkit/source/helper/property.cxx toolkit/source/helper/registerservices.cxx toolkit/source/helper/servicenames.cxx toolkit/source/helper/throbberimpl.cxx toolkit/source/helper/tkresmgr.cxx tools/StaticLibrary_ooopathutils.mk tools/bootstrp/addexes/makefile.mk tools/bootstrp/addexes2/makefile.mk tools/bootstrp/addexes2/mkfilt.cxx tools/bootstrp/command.cxx tools/bootstrp/cppdep.cxx tools/bootstrp/iserver.cxx tools/bootstrp/makefile.mk tools/bootstrp/mkcreate.cxx tools/bootstrp/prj.cxx tools/bootstrp/rscdep.cxx tools/bootstrp/sstring.cxx tools/inc/bootstrp/command.hxx tools/inc/bootstrp/mkcreate.hxx tools/inc/bootstrp/prj.hxx tools/inc/bootstrp/sstring.hxx tools/inc/tools/agapi.hxx tools/inc/tools/agitem.hxx tools/inc/tools/chapi.hxx tools/inc/tools/download.hxx tools/inc/tools/eacopier.hxx tools/inc/tools/fract.hxx tools/inc/tools/fsys.hxx tools/inc/tools/geninfo.hxx tools/inc/tools/globname.hxx tools/inc/tools/inetmime.hxx tools/inc/tools/multisel.hxx tools/inc/tools/poly.hxx tools/inc/tools/postsys.h tools/inc/tools/postwin.h tools/inc/tools/presys.h tools/inc/tools/prewin.h tools/inc/tools/pstm.hxx tools/inc/tools/ref.hxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/inc/tools/table.hxx tools/inc/tools/urlkeys.hxx tools/inc/tools/urlobj.hxx tools/prj/build.lst tools/prj/d.lst tools/qa/makefile.mk tools/source/communi/geninfo.cxx tools/source/debug/debug.cxx tools/source/fsys/dirent.cxx tools/source/fsys/tdir.cxx tools/source/fsys/unx.cxx tools/source/fsys/urlobj.cxx tools/source/generic/color.cxx tools/source/generic/config.cxx tools/source/generic/fract.cxx tools/source/inet/inetmime.cxx tools/source/memtools/multisel.cxx tools/source/memtools/table.cxx tools/source/rc/resmgr.cxx tools/source/ref/globname.cxx tools/source/ref/pstm.cxx tools/source/solar/solar.c tools/source/stream/strmos2.cxx tools/source/stream/strmunx.cxx tools/source/stream/strmwnt.cxx tools/source/string/makefile.mk tools/source/testtoolloader/testtoolloader.cxx tools/test/makefile.mk tools/util/makefile.mk tools/win/inc/dll.hxx tools/win/inc/parser.hxx tools/win/inc/shellex.h tools/win/inc/shutil.h tools/win/inc/toolsdll.hxx tools/win/inc/winshell.hxx tools/workben/makefile.mk ucbhelper/source/client/proxydecider.cxx ucbhelper/workben/ucbexplorer/ucbexplorer.hrc unotools/inc/unotools/unotunnelhelper.hxx unotools/source/config/fltrcfg.cxx unotools/source/config/lingucfg.cxx unotools/source/config/misccfg.cxx unotools/source/config/pathoptions.cxx unotools/source/config/searchopt.cxx unotools/source/i18n/localedatawrapper.cxx unotools/source/ucbhelper/localfilehelper.cxx unotools/source/ucbhelper/ucbhelper.cxx unotools/source/ucbhelper/xtempfile.cxx vcl/aqua/inc/salbmp.h vcl/aqua/inc/salgdi.h vcl/aqua/inc/salinst.h vcl/aqua/source/app/salinst.cxx vcl/aqua/source/gdi/aquaprintaccessoryview.mm vcl/aqua/source/gdi/salgdi.cxx vcl/aqua/source/gdi/salprn.cxx vcl/aqua/source/window/salframeview.mm vcl/aqua/source/window/salobj.cxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/brdwin.hxx vcl/inc/vcl/button.hxx vcl/inc/vcl/cmdevt.hxx vcl/inc/vcl/cvtgrf.hxx vcl/inc/vcl/dialog.hxx vcl/inc/vcl/dockwin.hxx vcl/inc/vcl/event.hxx vcl/inc/vcl/fixed.hxx vcl/inc/vcl/fldunit.hxx vcl/inc/vcl/floatwin.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/ilstbox.hxx vcl/inc/vcl/image.h vcl/inc/vcl/imgctrl.hxx vcl/inc/vcl/impbmpconv.hxx vcl/inc/vcl/impprn.hxx vcl/inc/vcl/jobset.h vcl/inc/vcl/keycodes.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/mapunit.hxx vcl/inc/vcl/menu.hxx vcl/inc/vcl/msgbox.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/prndlg.hxx vcl/inc/vcl/salatype.hxx vcl/inc/vcl/salbmp.hxx vcl/inc/vcl/salgdi.hxx vcl/inc/vcl/salinst.hxx vcl/inc/vcl/seleng.hxx vcl/inc/vcl/settings.hxx vcl/inc/vcl/smartid.hxx vcl/inc/vcl/status.hxx vcl/inc/vcl/strhelper.hxx vcl/inc/vcl/svapp.hxx vcl/inc/vcl/svdata.hxx vcl/inc/vcl/syschild.hxx vcl/inc/vcl/sysdata.hxx vcl/inc/vcl/taskpanelist.hxx vcl/inc/vcl/toolbox.hxx vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/windata.hxx vcl/inc/vcl/window.hxx vcl/inc/vcl/wintypes.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/gdi/salgdi.cxx vcl/os2/source/window/salmenu.cxx vcl/os2/source/window/salobj.cxx vcl/prj/build.lst vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/svapp.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/app/svmainhook.cxx vcl/source/app/unohelp.cxx vcl/source/app/vclevent.cxx vcl/source/control/button.cxx vcl/source/control/combobox.cxx vcl/source/control/edit.cxx vcl/source/control/field.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/imgctrl.cxx vcl/source/control/makefile.mk vcl/source/control/tabctrl.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmap4.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/font.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/image.cxx vcl/source/gdi/impimage.cxx vcl/source/gdi/jobset.cxx vcl/source/gdi/makefile.mk vcl/source/gdi/metaact.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdevnative.cxx vcl/source/gdi/pdfwriter.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/print3.cxx vcl/source/gdi/salmisc.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_textsrc.hxx vcl/source/helper/canvasbitmap.cxx vcl/source/helper/smartid.cxx vcl/source/helper/xconnection.cxx vcl/source/src/btntext.src vcl/source/src/images.src vcl/source/src/print.src vcl/source/window/accel.cxx vcl/source/window/accmgr.cxx vcl/source/window/brdwin.cxx vcl/source/window/btndlg.cxx vcl/source/window/dlgctrl.cxx vcl/source/window/javachild.cxx vcl/source/window/menu.cxx vcl/source/window/msgbox.cxx vcl/source/window/printdlg.cxx vcl/source/window/status.cxx vcl/source/window/syschild.cxx vcl/source/window/toolbox.cxx vcl/source/window/toolbox2.cxx vcl/source/window/window.cxx vcl/source/window/window2.cxx vcl/source/window/wrkwin.cxx vcl/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkinst.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkobject.cxx vcl/unx/headless/svpbmp.hxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svpinst.cxx vcl/unx/headless/svpinst.hxx vcl/unx/headless/svpprn.cxx vcl/unx/headless/svpprn.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/unx/headless/svptext.cxx vcl/unx/inc/dtint.hxx vcl/unx/inc/plugins/gtk/gtkdata.hxx vcl/unx/inc/pspgraphics.h vcl/unx/inc/salbmp.h vcl/unx/inc/saldata.hxx vcl/unx/inc/saldisp.hxx vcl/unx/inc/salgdi.h vcl/unx/inc/salinst.h vcl/unx/inc/xfont.hxx vcl/unx/kde/kdedata.cxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/source/app/keysymnames.cxx vcl/unx/source/app/saldata.cxx vcl/unx/source/app/saldisp.cxx vcl/unx/source/app/salinst.cxx vcl/unx/source/app/wmadaptor.cxx vcl/unx/source/dtrans/X11_selection.cxx vcl/unx/source/dtrans/X11_service.cxx vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/salgdi.cxx vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salprnpsp.cxx vcl/unx/source/gdi/xfont.cxx vcl/unx/source/gdi/xlfd_attr.cxx vcl/unx/source/gdi/xlfd_attr.hxx vcl/unx/source/gdi/xlfd_extd.cxx vcl/unx/source/gdi/xlfd_extd.hxx vcl/unx/source/gdi/xlfd_smpl.cxx vcl/unx/source/gdi/xlfd_smpl.hxx vcl/unx/source/printer/ppdparser.cxx vcl/unx/source/printer/printerinfomanager.cxx vcl/unx/source/window/salframe.cxx vcl/unx/source/window/salmenu.cxx vcl/unx/source/window/salobj.cxx vcl/util/makefile2.pmk vcl/win/inc/salbmp.h vcl/win/inc/saldata.hxx vcl/win/inc/salgdi.h vcl/win/inc/salinst.h vcl/win/source/app/saldata.cxx vcl/win/source/app/salinst.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salprn.cxx vcl/win/source/gdi/winlayout.cxx vcl/win/source/window/salframe.cxx vcl/win/source/window/salobj.cxx vcl/workben/outdevgrind.cxx vos/inc/vos/execabl.hxx vos/inc/vos/macros.hxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/refernce.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/stream.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/process.cxx vos/source/signal.cxx vos/source/thread.cxx vos/source/timer.cxx
2011-03-11 14:24:23 +01:00
uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
if ( xI.is() )
{
Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
x >>= xISC;
}
}
return xISC;
}
// -----------------------------------------------------------------------
void Edit::ShowTruncationWarning( Window* pParent )
{
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
{
WarningBox aBox( pParent, ResId( SV_EDIT_WARNING_BOX, *pResMgr ) );
aBox.Execute();
}
}
// -----------------------------------------------------------------------
CWS-TOOLING: integrate CWS vcl96 2008-11-27 15:56:56 +0100 pl r264499 : #i95488# fix a snafu 2008-11-17 12:05:23 +0100 pl r263713 : #158795# catch bad_alloc 2008-11-14 17:26:25 +0100 pl r263687 : #i93018# new msgbox images 2008-11-14 17:00:28 +0100 pl r263686 : #i95488# treat chinese font heights like korean 2008-11-14 14:59:17 +0100 pl r263677 : #i92102# RTL fixes: toolbox selection, popup menus 2008-11-14 11:40:22 +0100 pl r263669 : #i75035# move tear off panels correctly also in RTL case (thanks ayaniger) 2008-11-13 18:15:51 +0100 pl r263658 : #i93018# message box images, add hc version 2008-11-13 15:49:41 +0100 pl r263647 : #b6726794# add: UNC paths (windows specific) 2008-11-13 12:51:37 +0100 pl r263632 : #i95803# do not dereference empty interface 2008-11-12 18:13:55 +0100 pl r263609 : #b6727144# fix and speed up xor mode for special case invert on MacOSX 2008-11-12 15:07:47 +0100 pl r263599 : #i95392# add csv to calc mimetypes (thanks cmc) 2008-11-12 14:52:13 +0100 pl r263598 : #i87633# paste strings larger than 64k in the hope that each contained line is shorter 2008-11-12 13:37:29 +0100 pl r263594 : #i96141# fix if statement (thanks cmc) 2008-11-12 13:06:22 +0100 pl r263588 : #i93831# remove windows from static set again 2008-11-11 18:15:06 +0100 pl r263571 : #i96089# fix some wrong parentheses (thanks cmc) 2008-11-04 20:50:40 +0100 pl r263336 : #i95388# do not confuse imageable area and margin 2008-11-03 18:39:25 +0100 pl r263304 : CWS-TOOLING: rebase CWS vcl96 to trunk@263288 (milestone: DEV300:m35) 2008-11-03 16:18:48 +0100 pl r263290 : #i92701# truncation warning only on paste 2008-11-03 15:53:42 +0100 pl r263289 : #i95296# use gtk plugin in more cases 2008-10-31 11:15:34 +0100 pl r262858 : #i94258# fix some PDF/A compatibility issues (thanks beppec56) 2008-10-30 14:24:24 +0100 pl r262825 : #i62033# do not read imcomplete resources (again) 2008-10-29 17:21:29 +0100 pl r262821 : #i95536# do not use deprecated gtk_draw_expander function 2008-10-21 18:00:29 +0200 pl r262574 : #i95220# use large icons for nicer display on KDE as well as Gnome taskbar 2008-10-17 16:01:43 +0200 pl r262290 : #i92822# build warning free on MacOSX 10.5
2008-12-01 13:29:22 +00:00
bool Edit::ImplTruncateToMaxLen( rtl::OUString& rStr, sal_uInt32 nSelectionLen ) const
{
CWS-TOOLING: integrate CWS vcl96 2008-11-27 15:56:56 +0100 pl r264499 : #i95488# fix a snafu 2008-11-17 12:05:23 +0100 pl r263713 : #158795# catch bad_alloc 2008-11-14 17:26:25 +0100 pl r263687 : #i93018# new msgbox images 2008-11-14 17:00:28 +0100 pl r263686 : #i95488# treat chinese font heights like korean 2008-11-14 14:59:17 +0100 pl r263677 : #i92102# RTL fixes: toolbox selection, popup menus 2008-11-14 11:40:22 +0100 pl r263669 : #i75035# move tear off panels correctly also in RTL case (thanks ayaniger) 2008-11-13 18:15:51 +0100 pl r263658 : #i93018# message box images, add hc version 2008-11-13 15:49:41 +0100 pl r263647 : #b6726794# add: UNC paths (windows specific) 2008-11-13 12:51:37 +0100 pl r263632 : #i95803# do not dereference empty interface 2008-11-12 18:13:55 +0100 pl r263609 : #b6727144# fix and speed up xor mode for special case invert on MacOSX 2008-11-12 15:07:47 +0100 pl r263599 : #i95392# add csv to calc mimetypes (thanks cmc) 2008-11-12 14:52:13 +0100 pl r263598 : #i87633# paste strings larger than 64k in the hope that each contained line is shorter 2008-11-12 13:37:29 +0100 pl r263594 : #i96141# fix if statement (thanks cmc) 2008-11-12 13:06:22 +0100 pl r263588 : #i93831# remove windows from static set again 2008-11-11 18:15:06 +0100 pl r263571 : #i96089# fix some wrong parentheses (thanks cmc) 2008-11-04 20:50:40 +0100 pl r263336 : #i95388# do not confuse imageable area and margin 2008-11-03 18:39:25 +0100 pl r263304 : CWS-TOOLING: rebase CWS vcl96 to trunk@263288 (milestone: DEV300:m35) 2008-11-03 16:18:48 +0100 pl r263290 : #i92701# truncation warning only on paste 2008-11-03 15:53:42 +0100 pl r263289 : #i95296# use gtk plugin in more cases 2008-10-31 11:15:34 +0100 pl r262858 : #i94258# fix some PDF/A compatibility issues (thanks beppec56) 2008-10-30 14:24:24 +0100 pl r262825 : #i62033# do not read imcomplete resources (again) 2008-10-29 17:21:29 +0100 pl r262821 : #i95536# do not use deprecated gtk_draw_expander function 2008-10-21 18:00:29 +0200 pl r262574 : #i95220# use large icons for nicer display on KDE as well as Gnome taskbar 2008-10-17 16:01:43 +0200 pl r262290 : #i92822# build warning free on MacOSX 10.5
2008-12-01 13:29:22 +00:00
bool bWasTruncated = false;
const sal_uInt32 nMaxLen = mnMaxTextLen < 65534 ? mnMaxTextLen : 65534;
sal_uInt32 nLenAfter = static_cast<sal_uInt32>(maText.Len()) + rStr.getLength() - nSelectionLen;
if ( nLenAfter > nMaxLen )
{
sal_uInt32 nErasePos = nMaxLen - static_cast<sal_uInt32>(maText.Len()) + nSelectionLen;
rStr = rStr.copy( 0, nErasePos );
CWS-TOOLING: integrate CWS vcl96 2008-11-27 15:56:56 +0100 pl r264499 : #i95488# fix a snafu 2008-11-17 12:05:23 +0100 pl r263713 : #158795# catch bad_alloc 2008-11-14 17:26:25 +0100 pl r263687 : #i93018# new msgbox images 2008-11-14 17:00:28 +0100 pl r263686 : #i95488# treat chinese font heights like korean 2008-11-14 14:59:17 +0100 pl r263677 : #i92102# RTL fixes: toolbox selection, popup menus 2008-11-14 11:40:22 +0100 pl r263669 : #i75035# move tear off panels correctly also in RTL case (thanks ayaniger) 2008-11-13 18:15:51 +0100 pl r263658 : #i93018# message box images, add hc version 2008-11-13 15:49:41 +0100 pl r263647 : #b6726794# add: UNC paths (windows specific) 2008-11-13 12:51:37 +0100 pl r263632 : #i95803# do not dereference empty interface 2008-11-12 18:13:55 +0100 pl r263609 : #b6727144# fix and speed up xor mode for special case invert on MacOSX 2008-11-12 15:07:47 +0100 pl r263599 : #i95392# add csv to calc mimetypes (thanks cmc) 2008-11-12 14:52:13 +0100 pl r263598 : #i87633# paste strings larger than 64k in the hope that each contained line is shorter 2008-11-12 13:37:29 +0100 pl r263594 : #i96141# fix if statement (thanks cmc) 2008-11-12 13:06:22 +0100 pl r263588 : #i93831# remove windows from static set again 2008-11-11 18:15:06 +0100 pl r263571 : #i96089# fix some wrong parentheses (thanks cmc) 2008-11-04 20:50:40 +0100 pl r263336 : #i95388# do not confuse imageable area and margin 2008-11-03 18:39:25 +0100 pl r263304 : CWS-TOOLING: rebase CWS vcl96 to trunk@263288 (milestone: DEV300:m35) 2008-11-03 16:18:48 +0100 pl r263290 : #i92701# truncation warning only on paste 2008-11-03 15:53:42 +0100 pl r263289 : #i95296# use gtk plugin in more cases 2008-10-31 11:15:34 +0100 pl r262858 : #i94258# fix some PDF/A compatibility issues (thanks beppec56) 2008-10-30 14:24:24 +0100 pl r262825 : #i62033# do not read imcomplete resources (again) 2008-10-29 17:21:29 +0100 pl r262821 : #i95536# do not use deprecated gtk_draw_expander function 2008-10-21 18:00:29 +0200 pl r262574 : #i95220# use large icons for nicer display on KDE as well as Gnome taskbar 2008-10-17 16:01:43 +0200 pl r262290 : #i92822# build warning free on MacOSX 10.5
2008-12-01 13:29:22 +00:00
bWasTruncated = true;
}
CWS-TOOLING: integrate CWS vcl96 2008-11-27 15:56:56 +0100 pl r264499 : #i95488# fix a snafu 2008-11-17 12:05:23 +0100 pl r263713 : #158795# catch bad_alloc 2008-11-14 17:26:25 +0100 pl r263687 : #i93018# new msgbox images 2008-11-14 17:00:28 +0100 pl r263686 : #i95488# treat chinese font heights like korean 2008-11-14 14:59:17 +0100 pl r263677 : #i92102# RTL fixes: toolbox selection, popup menus 2008-11-14 11:40:22 +0100 pl r263669 : #i75035# move tear off panels correctly also in RTL case (thanks ayaniger) 2008-11-13 18:15:51 +0100 pl r263658 : #i93018# message box images, add hc version 2008-11-13 15:49:41 +0100 pl r263647 : #b6726794# add: UNC paths (windows specific) 2008-11-13 12:51:37 +0100 pl r263632 : #i95803# do not dereference empty interface 2008-11-12 18:13:55 +0100 pl r263609 : #b6727144# fix and speed up xor mode for special case invert on MacOSX 2008-11-12 15:07:47 +0100 pl r263599 : #i95392# add csv to calc mimetypes (thanks cmc) 2008-11-12 14:52:13 +0100 pl r263598 : #i87633# paste strings larger than 64k in the hope that each contained line is shorter 2008-11-12 13:37:29 +0100 pl r263594 : #i96141# fix if statement (thanks cmc) 2008-11-12 13:06:22 +0100 pl r263588 : #i93831# remove windows from static set again 2008-11-11 18:15:06 +0100 pl r263571 : #i96089# fix some wrong parentheses (thanks cmc) 2008-11-04 20:50:40 +0100 pl r263336 : #i95388# do not confuse imageable area and margin 2008-11-03 18:39:25 +0100 pl r263304 : CWS-TOOLING: rebase CWS vcl96 to trunk@263288 (milestone: DEV300:m35) 2008-11-03 16:18:48 +0100 pl r263290 : #i92701# truncation warning only on paste 2008-11-03 15:53:42 +0100 pl r263289 : #i95296# use gtk plugin in more cases 2008-10-31 11:15:34 +0100 pl r262858 : #i94258# fix some PDF/A compatibility issues (thanks beppec56) 2008-10-30 14:24:24 +0100 pl r262825 : #i62033# do not read imcomplete resources (again) 2008-10-29 17:21:29 +0100 pl r262821 : #i95536# do not use deprecated gtk_draw_expander function 2008-10-21 18:00:29 +0200 pl r262574 : #i95220# use large icons for nicer display on KDE as well as Gnome taskbar 2008-10-17 16:01:43 +0200 pl r262290 : #i92822# build warning free on MacOSX 10.5
2008-12-01 13:29:22 +00:00
return bWasTruncated;
}
// -----------------------------------------------------------------------
void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_Bool bIsUserInput )
2000-09-18 16:07:07 +00:00
{
Selection aSelection( maSelection );
aSelection.Justify();
rtl::OUString aNewText( ImplGetValidString( rStr ) );
ImplTruncateToMaxLen( aNewText, aSelection.Len() );
2000-09-18 16:07:07 +00:00
ImplClearLayoutData();
2000-09-18 16:07:07 +00:00
if ( aSelection.Len() )
maText.Erase( (xub_StrLen)aSelection.Min(), (xub_StrLen)aSelection.Len() );
else if ( !mbInsertMode && (aSelection.Max() < maText.Len()) )
maText.Erase( (xub_StrLen)aSelection.Max(), 1 );
// take care of input-sequence-checking now
if (bIsUserInput && rStr.Len())
{
DBG_ASSERT( rStr.Len() == 1, "unexpected string length. User input is expected to providse 1 char only!" );
// determine if input-sequence-checking should be applied or not
//
static OUString sModule( RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/I18N") );
static OUString sRelNode( RTL_CONSTASCII_USTRINGPARAM("CTL") );
static OUString sCTLSequenceChecking( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceChecking") );
static OUString sCTLSequenceCheckingRestricted( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingRestricted") );
static OUString sCTLSequenceCheckingTypeAndReplace( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingTypeAndReplace") );
static OUString sCTLFont( RTL_CONSTASCII_USTRINGPARAM("CTLFont") );
//
sal_Bool bCTLSequenceChecking = sal_False;
sal_Bool bCTLSequenceCheckingRestricted = sal_False;
sal_Bool bCTLSequenceCheckingTypeAndReplace = sal_False;
sal_Bool bCTLFontEnabled = sal_False;
sal_Bool bIsInputSequenceChecking = sal_False;
//
// get access to the configuration of this office module
try
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
uno::Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
xMSF,
sModule,
::comphelper::ConfigurationHelper::E_READONLY ),
uno::UNO_QUERY );
//!! get values from configuration.
//!! we can't use SvtCTLOptions here since vcl must not be linked
//!! against svtools. (It is already the other way around.)
Any aCTLSequenceChecking = ::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, sCTLSequenceChecking );
Any aCTLSequenceCheckingRestricted = ::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, sCTLSequenceCheckingRestricted );
Any aCTLSequenceCheckingTypeAndReplace = ::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, sCTLSequenceCheckingTypeAndReplace );
Any aCTLFontEnabled = ::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, sCTLFont );
aCTLSequenceChecking >>= bCTLSequenceChecking;
aCTLSequenceCheckingRestricted >>= bCTLSequenceCheckingRestricted;
aCTLSequenceCheckingTypeAndReplace >>= bCTLSequenceCheckingTypeAndReplace;
aCTLFontEnabled >>= bCTLFontEnabled;
}
catch(...)
{
bIsInputSequenceChecking = sal_False; // continue with inserting the new text
}
//
uno::Reference < i18n::XBreakIterator > xBI( ImplGetBreakIterator(), UNO_QUERY );
bIsInputSequenceChecking = rStr.Len() == 1 &&
bCTLFontEnabled &&
bCTLSequenceChecking &&
aSelection.Min() > 0 && /* first char needs not to be checked */
xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( rStr, 0 );
uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
if (bIsInputSequenceChecking && (xISC = ImplGetInputSequenceChecker()).is())
{
sal_Unicode cChar = rStr.GetChar(0);
xub_StrLen nTmpPos = static_cast< xub_StrLen >( aSelection.Min() );
sal_Int16 nCheckMode = bCTLSequenceCheckingRestricted ?
i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
// the text that needs to be checked is only the one
// before the current cursor position
rtl::OUString aOldText( maText.Copy(0, nTmpPos) );
rtl::OUString aTmpText( aOldText );
if (bCTLSequenceCheckingTypeAndReplace)
{
xISC->correctInputSequence( aTmpText, nTmpPos - 1, cChar, nCheckMode );
// find position of first character that has changed
sal_Int32 nOldLen = aOldText.getLength();
sal_Int32 nTmpLen = aTmpText.getLength();
const sal_Unicode *pOldTxt = aOldText.getStr();
const sal_Unicode *pTmpTxt = aTmpText.getStr();
sal_Int32 nChgPos = 0;
while ( nChgPos < nOldLen && nChgPos < nTmpLen &&
pOldTxt[nChgPos] == pTmpTxt[nChgPos] )
++nChgPos;
xub_StrLen nChgLen = static_cast< xub_StrLen >( nTmpLen - nChgPos );
String aChgText( aTmpText.copy( nChgPos ), nChgLen );
// remove text from first pos to be changed to current pos
maText.Erase( static_cast< xub_StrLen >( nChgPos ), static_cast< xub_StrLen >( nTmpPos - nChgPos ) );
if (aChgText.Len())
{
aNewText = aChgText;
aSelection.Min() = nChgPos; // position for new text to be inserted
}
else
aNewText = String::EmptyString();
}
else
{
// should the character be ignored (i.e. not get inserted) ?
if (!xISC->checkInputSequence( aOldText, nTmpPos - 1, cChar, nCheckMode ))
aNewText = String::EmptyString();
}
}
// at this point now we will insert the non-empty text 'normally' some lines below...
}
if ( aNewText.getLength() )
maText.Insert( String( aNewText ), (xub_StrLen)aSelection.Min() );
2000-09-18 16:07:07 +00:00
if ( !pNewSel )
{
maSelection.Min() = aSelection.Min() + aNewText.getLength();
2000-09-18 16:07:07 +00:00
maSelection.Max() = maSelection.Min();
}
else
{
maSelection = *pNewSel;
if ( maSelection.Min() > maText.Len() )
maSelection.Min() = maText.Len();
if ( maSelection.Max() > maText.Len() )
maSelection.Max() = maText.Len();
}
ImplAlignAndPaint();
mbInternModified = sal_True;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
{
// Der Text wird dadurch geloescht das der alte Text komplett 'selektiert'
// wird, dann InsertText, damit flackerfrei.
if ( ( rText.Len() <= mnMaxTextLen ) && ( (rText != maText) || (pNewSelection && (*pNewSelection != maSelection)) ) )
2000-09-18 16:07:07 +00:00
{
ImplClearLayoutData();
2000-09-18 16:07:07 +00:00
maSelection.Min() = 0;
maSelection.Max() = maText.Len();
if ( mnXOffset || HasPaintEvent() )
{
mnXOffset = 0;
maText = ImplGetValidString( rText );
2000-09-18 16:07:07 +00:00
// #i54929# recalculate mnXOffset before ImplSetSelection,
// else cursor ends up in wrong position
ImplAlign();
2000-09-18 16:07:07 +00:00
if ( pNewSelection )
ImplSetSelection( *pNewSelection, sal_False );
2000-09-18 16:07:07 +00:00
if ( mnXOffset && !pNewSelection )
maSelection.Max() = 0;
Invalidate();
}
else
ImplInsertText( rText, pNewSelection );
ImplCallEventListeners( VCLEVENT_EDIT_MODIFY );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
int Edit::ImplGetNativeControlType()
{
int nCtrl = 0;
Window *pControl = mbIsSubEdit ? GetParent() : this;
switch( pControl->GetType() )
{
case WINDOW_COMBOBOX:
case WINDOW_PATTERNBOX:
case WINDOW_NUMERICBOX:
case WINDOW_METRICBOX:
case WINDOW_CURRENCYBOX:
case WINDOW_DATEBOX:
case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
nCtrl = CTRL_COMBOBOX;
break;
case WINDOW_MULTILINEEDIT:
if ( GetWindow( WINDOW_BORDER ) != this )
nCtrl = CTRL_MULTILINE_EDITBOX;
else
nCtrl = CTRL_EDITBOX_NOBORDER;
break;
case WINDOW_EDIT:
case WINDOW_PATTERNFIELD:
case WINDOW_METRICFIELD:
case WINDOW_CURRENCYFIELD:
case WINDOW_DATEFIELD:
case WINDOW_TIMEFIELD:
case WINDOW_LONGCURRENCYFIELD:
case WINDOW_NUMERICFIELD:
case WINDOW_SPINFIELD:
if( pControl->GetStyle() & WB_SPIN )
nCtrl = CTRL_SPINBOX;
else
{
if ( GetWindow( WINDOW_BORDER ) != this )
nCtrl = CTRL_EDITBOX;
else
nCtrl = CTRL_EDITBOX_NOBORDER;
}
break;
default:
nCtrl = CTRL_EDITBOX;
}
return nCtrl;
}
2000-09-18 16:07:07 +00:00
void Edit::ImplClearBackground( long nXStart, long nXEnd )
{
/*
* note: at this point the cursor must be switched off already
*/
2000-09-18 16:07:07 +00:00
Point aTmpPoint;
Rectangle aRect( aTmpPoint, GetOutputSizePixel() );
aRect.Left() = nXStart;
aRect.Right() = nXEnd;
if( ImplUseNativeBorder( GetStyle() ) || IsPaintTransparent() )
{
// draw the inner part by painting the whole control using its border window
Window *pControl = this;
Window *pBorder = GetWindow( WINDOW_BORDER );
if( pBorder == this )
{
// we have no border, use parent
pControl = mbIsSubEdit ? GetParent() : this;
pBorder = pControl->GetWindow( WINDOW_BORDER );
if( pBorder == this )
pBorder = GetParent();
}
if( pBorder )
{
// set proper clipping region to not overdraw the whole control
Region aClipRgn = GetPaintRegion();
if( !aClipRgn.IsNull() )
{
// transform clipping region to border window's coordinate system
if( IsRTLEnabled() != pBorder->IsRTLEnabled() && Application::GetSettings().GetLayoutRTL() )
{
// need to mirror in case border is not RTL but edit is (or vice versa)
// mirror
Rectangle aBounds( aClipRgn.GetBoundRect() );
int xNew = GetOutputSizePixel().Width() - aBounds.GetWidth() - aBounds.Left();
aClipRgn.Move( xNew - aBounds.Left(), 0 );
// move offset of border window
Point aBorderOffs;
aBorderOffs = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aBorderOffs ) );
aClipRgn.Move( aBorderOffs.X(), aBorderOffs.Y() );
}
else
{
// normal case
Point aBorderOffs;
aBorderOffs = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aBorderOffs ) );
aClipRgn.Move( aBorderOffs.X(), aBorderOffs.Y() );
}
Region oldRgn( pBorder->GetClipRegion() );
pBorder->SetClipRegion( aClipRgn );
pBorder->Paint( Rectangle() );
pBorder->SetClipRegion( oldRgn );
}
else
pBorder->Paint( Rectangle() );
}
}
else
Erase( aRect );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
2000-09-18 16:07:07 +00:00
{
if ( !IsUpdateMode() || ( bOnlyIfVisible && !IsReallyVisible() ) )
return;
Cursor* pCursor = GetCursor();
XubString aText = ImplGetText();
2002-09-25 16:13:57 +00:00
long nTextPos = 0;
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
sal_Int32* pDX = nDXBuffer;
if( aText.Len() )
2002-09-25 16:13:57 +00:00
{
if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
}
2002-09-25 16:13:57 +00:00
GetCaretPositions( aText, pDX, 0, aText.Len() );
2002-09-25 16:13:57 +00:00
if( maSelection.Max() < aText.Len() )
nTextPos = pDX[ 2*maSelection.Max() ];
else
nTextPos = pDX[ 2*aText.Len()-1 ];
}
2000-09-18 16:07:07 +00:00
long nCursorWidth = 0;
if ( !mbInsertMode && !maSelection.Len() && (maSelection.Max() < aText.Len()) )
nCursorWidth = GetTextWidth( aText, (xub_StrLen)maSelection.Max(), 1 );
2002-09-25 16:13:57 +00:00
long nCursorPosX = nTextPos + mnXOffset + ImplGetExtraOffset();
2000-09-18 16:07:07 +00:00
// Cursor muss im sichtbaren Bereich landen:
const Size aOutSize = GetOutputSizePixel();
2000-09-18 16:07:07 +00:00
if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.Width()) )
{
long nOldXOffset = mnXOffset;
if ( nCursorPosX < 0 )
{
2002-09-25 16:13:57 +00:00
mnXOffset = - nTextPos;
2000-09-18 16:07:07 +00:00
long nMaxX = 0;
mnXOffset += aOutSize.Width() / 5;
if ( mnXOffset > nMaxX )
mnXOffset = nMaxX;
}
else
{
2002-09-25 16:13:57 +00:00
mnXOffset = (aOutSize.Width()-ImplGetExtraOffset()) - nTextPos;
2000-09-18 16:07:07 +00:00
// Etwas mehr?
2002-09-25 16:13:57 +00:00
if ( (aOutSize.Width()-ImplGetExtraOffset()) < nTextPos )
2000-09-18 16:07:07 +00:00
{
long nMaxNegX = (aOutSize.Width()-ImplGetExtraOffset()) - GetTextWidth( aText );
2000-09-18 16:07:07 +00:00
mnXOffset -= aOutSize.Width() / 5;
if ( mnXOffset < nMaxNegX ) // beides negativ...
mnXOffset = nMaxNegX;
}
}
2002-09-25 16:13:57 +00:00
nCursorPosX = nTextPos + mnXOffset + ImplGetExtraOffset();
2000-09-18 16:07:07 +00:00
if ( nCursorPosX == aOutSize.Width() ) // dann nicht sichtbar...
nCursorPosX--;
if ( mnXOffset != nOldXOffset )
ImplInvalidateOrRepaint();
2000-09-18 16:07:07 +00:00
}
const long nTextHeight = GetTextHeight();
const long nCursorPosY = ImplGetTextYPosition();
2000-09-18 16:07:07 +00:00
pCursor->SetPos( Point( nCursorPosX, nCursorPosY ) );
pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
pCursor->Show();
2002-09-25 16:13:57 +00:00
if( pDXBuffer )
2002-10-01 14:43:23 +00:00
delete [] pDXBuffer;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplAlign()
{
long nTextWidth = GetTextWidth( ImplGetText() );
long nOutWidth = GetOutputSizePixel().Width();
2001-07-18 16:07:21 +00:00
if ( mnAlign == EDIT_ALIGN_LEFT )
{
if( mnXOffset && ( nTextWidth < nOutWidth ) )
mnXOffset = 0;
}
else if ( mnAlign == EDIT_ALIGN_RIGHT )
2000-09-18 16:07:07 +00:00
{
2002-09-13 15:01:29 +00:00
long nMinXOffset = nOutWidth - nTextWidth - 1 - ImplGetExtraOffset();
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
bool bRTL = IsRTLEnabled();
if( mbIsSubEdit && GetParent() )
bRTL = GetParent()->IsRTLEnabled();
if( bRTL )
2002-09-25 16:13:57 +00:00
{
if( nTextWidth < nOutWidth )
2002-09-25 16:13:57 +00:00
mnXOffset = nMinXOffset;
}
else
{
if( nTextWidth < nOutWidth )
mnXOffset = nMinXOffset;
else if ( mnXOffset < nMinXOffset )
2002-09-25 16:13:57 +00:00
mnXOffset = nMinXOffset;
}
2000-09-18 16:07:07 +00:00
}
else if( mnAlign == EDIT_ALIGN_CENTER )
{
// Mit Abfrage schoener, wenn gescrollt, dann aber nicht zentriert im gescrollten Zustand...
// if ( nTextWidth < nOutWidth )
mnXOffset = (nOutWidth - nTextWidth) / 2;
}
}
// -----------------------------------------------------------------------
void Edit::ImplAlignAndPaint()
2000-09-18 16:07:07 +00:00
{
ImplAlign();
ImplInvalidateOrRepaint( 0, STRING_LEN );
2000-09-18 16:07:07 +00:00
ImplShowCursor();
}
// -----------------------------------------------------------------------
xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
2000-09-18 16:07:07 +00:00
{
2002-09-25 16:13:57 +00:00
xub_StrLen nIndex = STRING_LEN;
String aText = ImplGetText();
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
sal_Int32* pDX = nDXBuffer;
if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
2002-09-25 16:13:57 +00:00
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
2002-09-25 16:13:57 +00:00
pDX = pDXBuffer;
}
GetCaretPositions( aText, pDX, 0, aText.Len() );
long nX = rWindowPos.X() - mnXOffset - ImplGetExtraOffset();
2002-09-25 16:13:57 +00:00
for( int i = 0; i < aText.Len(); i++ )
{
if( (pDX[2*i] >= nX && pDX[2*i+1] <= nX) ||
(pDX[2*i+1] >= nX && pDX[2*i] <= nX))
{
nIndex = sal::static_int_cast<xub_StrLen>(i);
if( pDX[2*i] < pDX[2*i+1] )
{
if( nX > (pDX[2*i]+pDX[2*i+1])/2 )
nIndex++;
}
else
{
if( nX < (pDX[2*i]+pDX[2*i+1])/2 )
nIndex++;
}
2002-09-25 16:13:57 +00:00
break;
}
}
if( nIndex == STRING_LEN )
{
nIndex = 0;
long nDiff = Abs( pDX[0]-nX );
for( int i = 1; i < aText.Len(); i++ )
{
long nNewDiff = Abs( pDX[2*i]-nX );
if( nNewDiff < nDiff )
{
nIndex = sal::static_int_cast<xub_StrLen>(i);
nDiff = nNewDiff;
}
}
if( nIndex == aText.Len()-1 && Abs( pDX[2*nIndex+1] - nX ) < nDiff )
nIndex = STRING_LEN;
}
2002-09-25 16:13:57 +00:00
if( pDXBuffer )
2002-10-01 14:43:23 +00:00
delete [] pDXBuffer;
2002-09-25 16:13:57 +00:00
return nIndex;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect )
2000-09-18 16:07:07 +00:00
{
Selection aSelection( maSelection );
aSelection.Max() = nChar;
if ( !bSelect )
aSelection.Min() = aSelection.Max();
ImplSetSelection( aSelection );
}
// -----------------------------------------------------------------------
void Edit::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
xub_StrLen nTextLength = ReadShortRes();
if ( nTextLength )
SetMaxTextLen( nTextLength );
}
// -----------------------------------------------------------------------
void Edit::ImplCopyToSelectionClipboard()
{
if ( GetSelection().Len() )
{
::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(GetPrimarySelection());
ImplCopy( aSelection );
}
}
2001-08-20 10:09:37 +00:00
void Edit::ImplCopy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
{
::vcl::unohelper::TextDataObject::CopyStringTo( GetSelected(), rxClipboard );
2001-08-20 10:09:37 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
{
if ( rxClipboard.is() )
{
uno::Reference< datatransfer::XTransferable > xDataObj;
2001-08-20 10:09:37 +00:00
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
try
{
xDataObj = rxClipboard->getContents();
}
catch( const ::com::sun::star::uno::Exception& )
{
}
2001-08-20 10:09:37 +00:00
Application::AcquireSolarMutex( nRef );
2001-08-20 10:09:37 +00:00
if ( xDataObj.is() )
{
datatransfer::DataFlavor aFlavor;
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor );
2002-11-08 09:19:07 +00:00
try
2001-08-20 10:09:37 +00:00
{
uno::Any aData = xDataObj->getTransferData( aFlavor );
::rtl::OUString aText;
aData >>= aText;
CWS-TOOLING: integrate CWS vcl96 2008-11-27 15:56:56 +0100 pl r264499 : #i95488# fix a snafu 2008-11-17 12:05:23 +0100 pl r263713 : #158795# catch bad_alloc 2008-11-14 17:26:25 +0100 pl r263687 : #i93018# new msgbox images 2008-11-14 17:00:28 +0100 pl r263686 : #i95488# treat chinese font heights like korean 2008-11-14 14:59:17 +0100 pl r263677 : #i92102# RTL fixes: toolbox selection, popup menus 2008-11-14 11:40:22 +0100 pl r263669 : #i75035# move tear off panels correctly also in RTL case (thanks ayaniger) 2008-11-13 18:15:51 +0100 pl r263658 : #i93018# message box images, add hc version 2008-11-13 15:49:41 +0100 pl r263647 : #b6726794# add: UNC paths (windows specific) 2008-11-13 12:51:37 +0100 pl r263632 : #i95803# do not dereference empty interface 2008-11-12 18:13:55 +0100 pl r263609 : #b6727144# fix and speed up xor mode for special case invert on MacOSX 2008-11-12 15:07:47 +0100 pl r263599 : #i95392# add csv to calc mimetypes (thanks cmc) 2008-11-12 14:52:13 +0100 pl r263598 : #i87633# paste strings larger than 64k in the hope that each contained line is shorter 2008-11-12 13:37:29 +0100 pl r263594 : #i96141# fix if statement (thanks cmc) 2008-11-12 13:06:22 +0100 pl r263588 : #i93831# remove windows from static set again 2008-11-11 18:15:06 +0100 pl r263571 : #i96089# fix some wrong parentheses (thanks cmc) 2008-11-04 20:50:40 +0100 pl r263336 : #i95388# do not confuse imageable area and margin 2008-11-03 18:39:25 +0100 pl r263304 : CWS-TOOLING: rebase CWS vcl96 to trunk@263288 (milestone: DEV300:m35) 2008-11-03 16:18:48 +0100 pl r263290 : #i92701# truncation warning only on paste 2008-11-03 15:53:42 +0100 pl r263289 : #i95296# use gtk plugin in more cases 2008-10-31 11:15:34 +0100 pl r262858 : #i94258# fix some PDF/A compatibility issues (thanks beppec56) 2008-10-30 14:24:24 +0100 pl r262825 : #i62033# do not read imcomplete resources (again) 2008-10-29 17:21:29 +0100 pl r262821 : #i95536# do not use deprecated gtk_draw_expander function 2008-10-21 18:00:29 +0200 pl r262574 : #i95220# use large icons for nicer display on KDE as well as Gnome taskbar 2008-10-17 16:01:43 +0200 pl r262290 : #i92822# build warning free on MacOSX 10.5
2008-12-01 13:29:22 +00:00
if( ImplTruncateToMaxLen( aText, maSelection.Len() ) )
ShowTruncationWarning( const_cast<Edit*>(this) );
2001-08-20 10:09:37 +00:00
ReplaceSelected( aText );
}
2002-11-08 09:19:07 +00:00
catch( const ::com::sun::star::uno::Exception& )
{
}
2001-08-20 10:09:37 +00:00
}
}
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void Edit::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( mpSubEdit )
{
Control::MouseButtonDown( rMEvt );
return;
}
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() );
Selection aSelection( maSelection );
aSelection.Justify();
if ( rMEvt.GetClicks() < 4 )
{
mbClickedInSelection = sal_False;
2000-09-18 16:07:07 +00:00
if ( rMEvt.GetClicks() == 3 )
{
2000-09-18 16:07:07 +00:00
ImplSetSelection( Selection( 0, 0xFFFF ) );
ImplCopyToSelectionClipboard();
}
2000-09-18 16:07:07 +00:00
else if ( rMEvt.GetClicks() == 2 )
{
uno::Reference < i18n::XBreakIterator > xBI = ImplGetBreakIterator();
2000-11-20 16:52:32 +00:00
i18n::Boundary aBoundary = xBI->getWordBoundary( maText, aSelection.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
2000-09-18 16:07:07 +00:00
ImplSetSelection( Selection( aBoundary.startPos, aBoundary.endPos ) );
ImplCopyToSelectionClipboard();
2000-09-18 16:07:07 +00:00
}
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) )
mbClickedInSelection = sal_True;
2000-09-18 16:07:07 +00:00
else if ( rMEvt.IsLeft() )
ImplSetCursorPos( nChar, rMEvt.IsShift() );
if ( !mbClickedInSelection && rMEvt.IsLeft() && ( rMEvt.GetClicks() == 1 ) )
StartTracking( STARTTRACK_SCROLLREPEAT );
}
mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren
2000-09-18 16:07:07 +00:00
GrabFocus();
mbInMBDown = sal_False;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( mbClickedInSelection && rMEvt.IsLeft() )
{
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() );
ImplSetCursorPos( nChar, sal_False );
mbClickedInSelection = sal_False;
2000-09-18 16:07:07 +00:00
}
2001-08-20 10:09:37 +00:00
else if ( rMEvt.IsMiddle() && !mbReadOnly &&
( GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION ) )
{
::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(Window::GetPrimarySelection());
ImplPaste( aSelection );
ImplModified();
2001-08-20 10:09:37 +00:00
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
if ( mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
ImplSetCursorPos( nChar, sal_False );
mbClickedInSelection = sal_False;
2000-09-18 16:07:07 +00:00
}
else if ( rTEvt.GetMouseEvent().IsLeft() )
2001-08-20 10:09:37 +00:00
{
ImplCopyToSelectionClipboard();
2001-08-20 10:09:37 +00:00
}
2000-09-18 16:07:07 +00:00
}
else
{
if( !mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
ImplSetCursorPos( nChar, sal_True );
2000-09-18 16:07:07 +00:00
}
}
if ( mpUpdateDataTimer && !mbIsSubEdit && mpUpdateDataTimer->IsActive() )
mpUpdateDataTimer->Start();//do not update while the user is still travelling in the control
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
2000-09-18 16:07:07 +00:00
{
sal_Bool bDone = sal_False;
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
2000-09-18 16:07:07 +00:00
KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
mbInternModified = sal_False;
2000-09-18 16:07:07 +00:00
if ( eFunc != KEYFUNC_DONTKNOW )
{
switch ( eFunc )
{
case KEYFUNC_CUT:
{
if ( !mbReadOnly && maSelection.Len() && !(GetStyle() & WB_PASSWORD) )
{
Cut();
ImplModified();
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
case KEYFUNC_COPY:
{
if ( !(GetStyle() & WB_PASSWORD) )
{
Copy();
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
case KEYFUNC_PASTE:
{
if ( !mbReadOnly )
{
Paste();
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
case KEYFUNC_UNDO:
{
if ( !mbReadOnly )
{
Undo();
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
default: // wird dann evtl. unten bearbeitet.
eFunc = KEYFUNC_DONTKNOW;
}
}
if ( !bDone && rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() )
{
if ( nCode == KEY_A )
{
ImplSetSelection( Selection( 0, maText.Len() ) );
bDone = sal_True;
}
else if ( rKEvt.GetKeyCode().IsShift() && (nCode == KEY_S) )
{
if ( pImplFncGetSpecialChars )
{
Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
XubString aChars = pImplFncGetSpecialChars( this, GetFont() );
SetSelection( aSaveSel );
if ( aChars.Len() )
{
ImplInsertText( aChars );
ImplModified();
}
bDone = sal_True;
}
}
}
if ( eFunc == KEYFUNC_DONTKNOW && ! bDone )
2000-09-18 16:07:07 +00:00
{
switch ( nCode )
{
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
case com::sun::star::awt::Key::SELECT_ALL:
{
ImplSetSelection( Selection( 0, maText.Len() ) );
bDone = sal_True;
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
}
break;
2000-09-18 16:07:07 +00:00
case KEY_LEFT:
case KEY_RIGHT:
case KEY_HOME:
case KEY_END:
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
case com::sun::star::awt::Key::MOVE_WORD_FORWARD:
case com::sun::star::awt::Key::SELECT_WORD_FORWARD:
case com::sun::star::awt::Key::MOVE_WORD_BACKWARD:
case com::sun::star::awt::Key::SELECT_WORD_BACKWARD:
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_LINE:
case com::sun::star::awt::Key::MOVE_TO_END_OF_LINE:
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_LINE:
case com::sun::star::awt::Key::SELECT_TO_END_OF_LINE:
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
case com::sun::star::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
case com::sun::star::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
case com::sun::star::awt::Key::MOVE_TO_END_OF_DOCUMENT:
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
case com::sun::star::awt::Key::SELECT_TO_END_OF_DOCUMENT:
2000-09-18 16:07:07 +00:00
{
if ( !rKEvt.GetKeyCode().IsMod2() )
{
ImplClearLayoutData();
uno::Reference < i18n::XBreakIterator > xBI = ImplGetBreakIterator();
2000-09-18 16:07:07 +00:00
Selection aSel( maSelection );
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
bool bWord = rKEvt.GetKeyCode().IsMod1();
bool bSelect = rKEvt.GetKeyCode().IsShift();
bool bGoLeft = (nCode == KEY_LEFT);
bool bGoRight = (nCode == KEY_RIGHT);
bool bGoHome = (nCode == KEY_HOME);
bool bGoEnd = (nCode == KEY_END);
switch( nCode )
{
case com::sun::star::awt::Key::MOVE_WORD_FORWARD:
bGoRight = bWord = true;break;
case com::sun::star::awt::Key::SELECT_WORD_FORWARD:
bGoRight = bSelect = bWord = true;break;
case com::sun::star::awt::Key::MOVE_WORD_BACKWARD:
bGoLeft = bWord = true;break;
case com::sun::star::awt::Key::SELECT_WORD_BACKWARD:
bGoLeft = bSelect = bWord = true;break;
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_LINE:
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
case com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
bSelect = true;
// fallthrough intended
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_LINE:
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
bGoHome = true;break;
case com::sun::star::awt::Key::SELECT_TO_END_OF_LINE:
case com::sun::star::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
case com::sun::star::awt::Key::SELECT_TO_END_OF_DOCUMENT:
bSelect = true;
// fallthrough intended
case com::sun::star::awt::Key::MOVE_TO_END_OF_LINE:
case com::sun::star::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
case com::sun::star::awt::Key::MOVE_TO_END_OF_DOCUMENT:
bGoEnd = true;break;
default:
break;
};
2000-09-18 16:07:07 +00:00
// Range wird in ImplSetSelection geprueft...
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
if ( bGoLeft && aSel.Max() )
2000-09-18 16:07:07 +00:00
{
if ( bWord )
{
2000-11-20 16:52:32 +00:00
i18n::Boundary aBoundary = xBI->getWordBoundary( maText, aSel.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
2000-09-18 16:07:07 +00:00
if ( aBoundary.startPos == aSel.Max() )
2000-11-20 16:52:32 +00:00
aBoundary = xBI->previousWord( maText, aSel.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
2000-09-18 16:07:07 +00:00
aSel.Max() = aBoundary.startPos;
}
else
{
sal_Int32 nCount = 1;
2000-11-20 16:52:32 +00:00
aSel.Max() = xBI->previousCharacters( maText, aSel.Max(), GetSettings().GetLocale(), i18n::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );
2000-09-18 16:07:07 +00:00
}
}
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
else if ( bGoRight && ( aSel.Max() < maText.Len() ) )
2000-09-18 16:07:07 +00:00
{
if ( bWord )
{
2000-11-20 16:52:32 +00:00
i18n::Boundary aBoundary = xBI->nextWord( maText, aSel.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
2000-09-18 16:07:07 +00:00
aSel.Max() = aBoundary.startPos;
}
else
{
sal_Int32 nCount = 1;
2000-11-20 16:52:32 +00:00
aSel.Max() = xBI->nextCharacters( maText, aSel.Max(), GetSettings().GetLocale(), i18n::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );
2000-09-18 16:07:07 +00:00
}
}
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
else if ( bGoHome )
{
2000-09-18 16:07:07 +00:00
aSel.Max() = 0;
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
}
else if ( bGoEnd )
{
2000-09-18 16:07:07 +00:00
aSel.Max() = 0xFFFF;
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
}
2000-09-18 16:07:07 +00:00
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
if ( !bSelect )
2000-09-18 16:07:07 +00:00
aSel.Min() = aSel.Max();
2001-08-20 10:09:37 +00:00
if ( aSel != GetSelection() )
{
ImplSetSelection( aSel );
ImplCopyToSelectionClipboard();
2001-08-20 10:09:37 +00:00
}
2000-09-18 16:07:07 +00:00
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
if ( bGoEnd && maAutocompleteHdl.IsSet() && !rKEvt.GetKeyCode().GetModifier() )
2000-09-18 16:07:07 +00:00
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.Len()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
maAutocompleteHdl.Call( this );
}
}
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
case com::sun::star::awt::Key::DELETE_WORD_BACKWARD:
case com::sun::star::awt::Key::DELETE_WORD_FORWARD:
case com::sun::star::awt::Key::DELETE_TO_BEGIN_OF_LINE:
case com::sun::star::awt::Key::DELETE_TO_END_OF_LINE:
2000-09-18 16:07:07 +00:00
case KEY_BACKSPACE:
case KEY_DELETE:
{
if ( !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
sal_uInt8 nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
sal_uInt8 nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
2000-09-18 16:07:07 +00:00
if ( (nMode == EDIT_DELMODE_RESTOFWORD) && rKEvt.GetKeyCode().IsShift() )
nMode = EDIT_DELMODE_RESTOFCONTENT;
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
switch( nCode )
{
case com::sun::star::awt::Key::DELETE_WORD_BACKWARD:
nDel = EDIT_DEL_LEFT;
nMode = EDIT_DELMODE_RESTOFWORD;
break;
case com::sun::star::awt::Key::DELETE_WORD_FORWARD:
nDel = EDIT_DEL_RIGHT;
nMode = EDIT_DELMODE_RESTOFWORD;
break;
case com::sun::star::awt::Key::DELETE_TO_BEGIN_OF_LINE:
nDel = EDIT_DEL_LEFT;
nMode = EDIT_DELMODE_RESTOFCONTENT;
break;
case com::sun::star::awt::Key::DELETE_TO_END_OF_LINE:
nDel = EDIT_DEL_RIGHT;
nMode = EDIT_DELMODE_RESTOFCONTENT;
break;
default: break;
}
2000-09-18 16:07:07 +00:00
xub_StrLen nOldLen = maText.Len();
ImplDelete( maSelection, nDel, nMode );
if ( maText.Len() != nOldLen )
ImplModified();
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
case KEY_INSERT:
{
2001-06-12 13:42:19 +00:00
if ( !mpIMEInfos && !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
2000-09-18 16:07:07 +00:00
{
SetInsertMode( !mbInsertMode );
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
/* #i101255# disable autocomplete tab forward/backward
users expect tab/shif-tab to move the focus to other controls
not suddenly to cycle the autocompletion
2000-09-18 16:07:07 +00:00
case KEY_TAB:
{
if ( !mbReadOnly && maAutocompleteHdl.IsSet() &&
maSelection.Min() && (maSelection.Min() == maText.Len()) &&
!rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() )
{
// Kein Autocomplete wenn alles Selektiert oder Edit leer, weil dann
// keine vernuenftige Tab-Steuerung!
if ( rKEvt.GetKeyCode().IsShift() )
meAutocompleteAction = AUTOCOMPLETE_TABBACKWARD;
else
meAutocompleteAction = AUTOCOMPLETE_TABFORWARD;
maAutocompleteHdl.Call( this );
// Wurde nichts veraendert, dann TAB fuer DialogControl
if ( GetSelection().Len() )
bDone = sal_True;
2000-09-18 16:07:07 +00:00
}
}
break;
*/
2000-09-18 16:07:07 +00:00
default:
{
if ( IsCharInput( rKEvt ) )
{
bDone = sal_True; // Auch bei ReadOnly die Zeichen schlucken.
2000-09-18 16:07:07 +00:00
if ( !mbReadOnly )
{
ImplInsertText( rKEvt.GetCharCode(), 0, sal_True );
2000-09-18 16:07:07 +00:00
if ( maAutocompleteHdl.IsSet() )
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.Len()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
maAutocompleteHdl.Call( this );
}
}
}
}
}
}
}
if ( mbInternModified )
ImplModified();
return bDone;
}
// -----------------------------------------------------------------------
void Edit::KeyInput( const KeyEvent& rKEvt )
{
if ( mpUpdateDataTimer && !mbIsSubEdit && mpUpdateDataTimer->IsActive() )
mpUpdateDataTimer->Start();//do not update while the user is still travelling in the control
2000-09-18 16:07:07 +00:00
if ( mpSubEdit || !ImplHandleKeyEvent( rKEvt ) )
Control::KeyInput( rKEvt );
}
// -----------------------------------------------------------------------
void Edit::FillLayoutData() const
{
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<Edit*>(this)->ImplRepaint( 0, STRING_LEN, true );
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void Edit::Paint( const Rectangle& )
{
if ( !mpSubEdit )
ImplRepaint();
}
// -----------------------------------------------------------------------
void Edit::Resize()
{
if ( !mpSubEdit && IsReallyVisible() )
{
Control::Resize();
2000-09-18 16:07:07 +00:00
// Wegen vertikaler Zentrierung...
mnXOffset = 0;
ImplAlign();
Invalidate();
ImplShowCursor();
}
}
// -----------------------------------------------------------------------
void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
2000-09-18 16:07:07 +00:00
{
ImplInitSettings( sal_True, sal_True, sal_True );
2000-09-18 16:07:07 +00:00
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Font aFont = GetDrawPixelFont( pDev );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
pDev->SetMapMode();
pDev->SetFont( aFont );
pDev->SetTextFillColor();
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
2000-09-18 16:07:07 +00:00
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
if ( bBorder )
{
ImplDrawFrame( pDev, aRect );
2000-09-18 16:07:07 +00:00
}
if ( bBackground )
{
pDev->SetFillColor( GetControlBackground() );
pDev->DrawRect( aRect );
}
}
// Inhalt
if ( ( nFlags & WINDOW_DRAW_MONO ) || ( eOutDevType == OUTDEV_PRINTER ) )
pDev->SetTextColor( Color( COL_BLACK ) );
else
{
if ( !(nFlags & WINDOW_DRAW_NODISABLE ) && !IsEnabled() )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
pDev->SetTextColor( rStyleSettings.GetDisableColor() );
}
else
{
pDev->SetTextColor( GetTextColor() );
}
}
XubString aText = ImplGetText();
long nTextHeight = pDev->GetTextHeight();
long nTextWidth = pDev->GetTextWidth( aText );
long nOnePixel = GetDrawPixel( pDev, 1 );
long nOffX = 3*nOnePixel;
long nOffY = (aSize.Height() - nTextHeight) / 2;
// Clipping?
if ( (nOffY < 0) ||
((nOffY+nTextHeight) > aSize.Height()) ||
((nOffX+nTextWidth) > aSize.Width()) )
{
Rectangle aClip( aPos, aSize );
if ( nTextHeight > aSize.Height() )
aClip.Bottom() += nTextHeight-aSize.Height()+1; // Damit HP-Drucker nicht 'weg-optimieren'
pDev->IntersectClipRegion( aClip );
}
if ( GetStyle() & WB_CENTER )
{
aPos.X() += (aSize.Width() - nTextWidth) / 2;
nOffX = 0;
}
else if ( GetStyle() & WB_RIGHT )
{
aPos.X() += aSize.Width() - nTextWidth;
nOffX = -nOffX;
}
2000-09-18 16:07:07 +00:00
pDev->DrawText( Point( aPos.X() + nOffX, aPos.Y() + nOffY ), aText );
pDev->Pop();
if ( GetSubEdit() )
{
GetSubEdit()->Draw( pDev, rPos, rSize, nFlags );
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ImplInvalidateOutermostBorder( Window* pWin )
{
// allow control to show focused state
Window *pInvalWin = pWin, *pBorder = pWin;
while( ( pBorder = pInvalWin->GetWindow( WINDOW_BORDER ) ) != pInvalWin && pBorder &&
pInvalWin->ImplGetFrame() == pBorder->ImplGetFrame() )
{
pInvalWin = pBorder;
}
pInvalWin->Invalidate( INVALIDATE_CHILDREN | INVALIDATE_UPDATE );
}
2000-09-18 16:07:07 +00:00
void Edit::GetFocus()
{
if ( mpSubEdit )
mpSubEdit->ImplGrabFocus( GetGetFocusFlags() );
else if ( !mbActivePopup )
{
maUndoText = maText;
sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
2000-09-18 16:07:07 +00:00
if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) )
&& ( GetGetFocusFlags() & (GETFOCUS_INIT|GETFOCUS_TAB|GETFOCUS_CURSOR|GETFOCUS_MNEMONIC) ) )
{
if ( nSelOptions & SELECTION_OPTION_SHOWFIRST )
{
maSelection.Min() = maText.Len();
maSelection.Max() = 0;
}
else
{
maSelection.Min() = 0;
maSelection.Max() = maText.Len();
}
if ( mbIsSubEdit )
((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
else
ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
2000-09-18 16:07:07 +00:00
}
ImplShowCursor();
// FIXME: this is currently only on aqua
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
}
else if ( maSelection.Len() )
2000-09-18 16:07:07 +00:00
{
// Selektion malen
if ( !HasPaintEvent() )
ImplInvalidateOrRepaint();
2000-09-18 16:07:07 +00:00
else
Invalidate();
}
2000-11-08 08:17:31 +00:00
SetInputContext( InputContext( GetFont(), !IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) );
2000-09-18 16:07:07 +00:00
}
Control::GetFocus();
}
// -----------------------------------------------------------------------
Window* Edit::GetPreferredKeyInputWindow()
{
if ( mpSubEdit )
return mpSubEdit->GetPreferredKeyInputWindow();
else
return this;
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void Edit::LoseFocus()
{
if ( mpUpdateDataTimer && !mbIsSubEdit && mpUpdateDataTimer->IsActive() )
{
//notify an update latest when the focus is lost
mpUpdateDataTimer->Stop();
mpUpdateDataTimer->Timeout();
}
2000-09-18 16:07:07 +00:00
if ( !mpSubEdit )
{
// FIXME: this is currently only on aqua
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
}
2000-09-18 16:07:07 +00:00
if ( !mbActivePopup && !( GetStyle() & WB_NOHIDESELECTION ) && maSelection.Len() )
ImplInvalidateOrRepaint(); // Selektion malen
2000-09-18 16:07:07 +00:00
}
Control::LoseFocus();
}
// -----------------------------------------------------------------------
void Edit::Command( const CommandEvent& rCEvt )
{
2001-02-14 07:32:01 +00:00
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
2000-09-18 16:07:07 +00:00
{
PopupMenu* pPopup = Edit::CreatePopupMenu();
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( rStyleSettings.GetOptions() & STYLE_OPTION_HIDEDISABLED )
pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !maSelection.Len() )
{
pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
2000-09-18 16:07:07 +00:00
}
if ( IsReadOnly() )
{
pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False );
pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False );
2000-09-18 16:07:07 +00:00
}
else
{
// Paste nur, wenn Text im Clipboard
sal_Bool bData = sal_False;
uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetClipboard();
2001-02-12 11:57:52 +00:00
if ( xClipboard.is() )
{
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
2001-02-12 11:57:52 +00:00
uno::Reference< datatransfer::XTransferable > xDataObj = xClipboard->getContents();
Application::AcquireSolarMutex( nRef );
2001-02-12 11:57:52 +00:00
if ( xDataObj.is() )
{
datatransfer::DataFlavor aFlavor;
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor );
bData = xDataObj->isDataFlavorSupported( aFlavor );
}
}
pPopup->EnableItem( SV_MENU_EDIT_PASTE, bData );
2000-09-18 16:07:07 +00:00
}
if ( maUndoText == maText )
pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
2000-09-18 16:07:07 +00:00
if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
2000-09-18 16:07:07 +00:00
if ( !pImplFncGetSpecialChars )
{
sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
2000-09-18 16:07:07 +00:00
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
mbActivePopup = sal_True;
2000-09-18 16:07:07 +00:00
Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
// !!! Irgendwann einmal Menu zentriert in der Selektion anzeigen !!!
Size aSize = GetOutputSizePixel();
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
sal_uInt16 n = pPopup->Execute( this, aPos );
2000-09-18 16:07:07 +00:00
Edit::DeletePopupMenu( pPopup );
SetSelection( aSaveSel );
switch ( n )
{
case SV_MENU_EDIT_UNDO:
Undo();
ImplModified();
break;
case SV_MENU_EDIT_CUT:
Cut();
ImplModified();
break;
case SV_MENU_EDIT_COPY:
Copy();
break;
case SV_MENU_EDIT_PASTE:
Paste();
ImplModified();
break;
case SV_MENU_EDIT_DELETE:
DeleteSelected();
ImplModified();
break;
case SV_MENU_EDIT_SELECTALL:
ImplSetSelection( Selection( 0, maText.Len() ) );
break;
case SV_MENU_EDIT_INSERTSYMBOL:
{
XubString aChars = pImplFncGetSpecialChars( this, GetFont() );
SetSelection( aSaveSel );
if ( aChars.Len() )
{
ImplInsertText( aChars );
ImplModified();
}
}
break;
}
mbActivePopup = sal_False;
2000-09-18 16:07:07 +00:00
}
else if ( rCEvt.GetCommand() == COMMAND_VOICE )
{
const CommandVoiceData* pData = rCEvt.GetVoiceData();
if ( pData->GetType() == VOICECOMMANDTYPE_DICTATION )
{
switch ( pData->GetCommand() )
{
case DICTATIONCOMMAND_UNKNOWN:
{
ReplaceSelected( pData->GetText() );
}
break;
case DICTATIONCOMMAND_LEFT:
{
ImplHandleKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, KEY_MOD1 ) ) );
}
break;
case DICTATIONCOMMAND_RIGHT:
{
ImplHandleKeyEvent( KeyEvent( 0, KeyCode( KEY_RIGHT, KEY_MOD1 ) ) );
}
break;
case DICTATIONCOMMAND_UNDO:
{
Undo();
}
break;
case DICTATIONCOMMAND_DEL:
{
ImplHandleKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, KEY_MOD1|KEY_SHIFT ) ) );
DeleteSelected();
}
break;
}
}
}
else if ( rCEvt.GetCommand() == COMMAND_STARTEXTTEXTINPUT )
{
DeleteSelected();
delete mpIMEInfos;
2001-06-12 13:42:19 +00:00
xub_StrLen nPos = (xub_StrLen)maSelection.Max();
mpIMEInfos = new Impl_IMEInfos( nPos, maText.Copy( nPos ) );
2000-11-08 08:17:31 +00:00
mpIMEInfos->bWasCursorOverwrite = !IsInsertMode();
2000-09-18 16:07:07 +00:00
}
else if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
{
sal_Bool bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
2000-09-18 16:07:07 +00:00
delete mpIMEInfos;
mpIMEInfos = NULL;
// Font wieder ohne Attribute einstellen, wird jetzt im Repaint nicht
// mehr neu initialisiert
ImplInitSettings( sal_True, sal_False, sal_False );
2000-11-08 08:17:31 +00:00
SetInsertMode( bInsertMode );
ImplModified();
// #i25161# call auto complete handler for ext text commit also
if ( maAutocompleteHdl.IsSet() )
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.Len()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
maAutocompleteHdl.Call( this );
}
}
2000-09-18 16:07:07 +00:00
}
else if ( rCEvt.GetCommand() == COMMAND_EXTTEXTINPUT )
{
const CommandExtTextInputData* pData = rCEvt.GetExtTextInputData();
maText.Erase( mpIMEInfos->nPos, mpIMEInfos->nLen );
maText.Insert( pData->GetText(), mpIMEInfos->nPos );
2001-06-12 13:42:19 +00:00
if ( mpIMEInfos->bWasCursorOverwrite )
{
sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen;
sal_uInt16 nNewIMETextLen = pData->GetText().Len();
2001-06-12 13:42:19 +00:00
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
2001-06-12 13:42:19 +00:00
maText.Insert( mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ), mpIMEInfos->nPos + nNewIMETextLen );
}
else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
2001-06-12 13:42:19 +00:00
{
// overwrite
sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
2001-06-12 13:42:19 +00:00
maText.Erase( mpIMEInfos->nPos + nNewIMETextLen, nOverwrite );
}
}
2000-09-18 16:07:07 +00:00
if ( pData->GetTextAttr() )
{
mpIMEInfos->CopyAttribs( pData->GetTextAttr(), pData->GetText().Len() );
mpIMEInfos->bCursor = pData->IsCursorVisible();
}
else
{
mpIMEInfos->DestroyAttribs();
}
ImplAlignAndPaint();
2000-09-18 16:07:07 +00:00
xub_StrLen nCursorPos = mpIMEInfos->nPos + pData->GetCursorPos();
SetSelection( Selection( nCursorPos, nCursorPos ) );
2000-11-08 08:17:31 +00:00
SetInsertMode( !pData->IsCursorOverwrite() );
2000-11-08 09:47:49 +00:00
if ( pData->IsCursorVisible() )
GetCursor()->Show();
else
GetCursor()->Hide();
2000-09-18 16:07:07 +00:00
}
2000-11-08 08:17:31 +00:00
else if ( rCEvt.GetCommand() == COMMAND_CURSORPOS )
2000-09-18 16:07:07 +00:00
{
2000-11-08 08:17:31 +00:00
if ( mpIMEInfos )
2000-09-18 16:07:07 +00:00
{
xub_StrLen nCursorPos = (sal_uInt16)GetSelection().Max();
2000-11-08 08:17:31 +00:00
SetCursorRect( NULL, GetTextWidth(
maText, nCursorPos, mpIMEInfos->nPos+mpIMEInfos->nLen-nCursorPos ) );
2000-09-18 16:07:07 +00:00
}
2001-08-08 09:40:38 +00:00
else
{
SetCursorRect();
}
2000-09-18 16:07:07 +00:00
}
2008-10-29 09:25:50 +00:00
else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE )
{
const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData();
Selection aSelection( pData->GetStart(), pData->GetEnd() );
SetSelection(aSelection);
}
2000-09-18 16:07:07 +00:00
else
Control::Command( rCEvt );
}
// -----------------------------------------------------------------------
void Edit::StateChanged( StateChangedType nType )
{
if ( nType == STATE_CHANGE_INITSHOW )
{
if ( !mpSubEdit )
{
mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
ImplAlign();
if ( !mpSubEdit )
ImplShowCursor( sal_False );
2000-09-18 16:07:07 +00:00
}
// update background (eventual SetPaintTransparent)
ImplInitSettings( sal_False, sal_False, sal_True );
2000-09-18 16:07:07 +00:00
}
else if ( nType == STATE_CHANGE_ENABLE )
{
if ( !mpSubEdit )
{
// Es aendert sich nur die Textfarbe...
ImplInvalidateOrRepaint( 0, 0xFFFF );
2000-09-18 16:07:07 +00:00
}
}
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
else if ( nType == STATE_CHANGE_STYLE || nType == STATE_CHANGE_MIRRORING )
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
WinBits nStyle = GetStyle();
if( nType == STATE_CHANGE_STYLE )
{
nStyle = ImplInitStyle( GetStyle() );
SetStyle( nStyle );
}
2000-09-18 16:07:07 +00:00
sal_uInt16 nOldAlign = mnAlign;
2000-09-18 16:07:07 +00:00
mnAlign = EDIT_ALIGN_LEFT;
2002-09-12 07:35:13 +00:00
// --- RTL --- hack: right align until keyinput and cursor travelling works
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
// edits are always RTL disabled
// however the parent edits contain the correct setting
if( mbIsSubEdit && GetParent()->IsRTLEnabled() )
{
if( GetParent()->GetStyle() & WB_LEFT )
mnAlign = EDIT_ALIGN_RIGHT;
if ( nType == STATE_CHANGE_MIRRORING )
SetLayoutMode( TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT );
}
else if( mbIsSubEdit && !GetParent()->IsRTLEnabled() )
{
if ( nType == STATE_CHANGE_MIRRORING )
SetLayoutMode( TEXT_LAYOUT_BIDI_LTR | TEXT_LAYOUT_TEXTORIGIN_LEFT );
}
2002-09-12 07:35:13 +00:00
2000-09-18 16:07:07 +00:00
if ( nStyle & WB_RIGHT )
mnAlign = EDIT_ALIGN_RIGHT;
else if ( nStyle & WB_CENTER )
mnAlign = EDIT_ALIGN_CENTER;
if ( maText.Len() && ( mnAlign != nOldAlign ) )
{
ImplAlign();
Invalidate();
}
}
else if ( nType == STATE_CHANGE_ZOOM )
{
if ( !mpSubEdit )
{
ImplInitSettings( sal_True, sal_False, sal_False );
ImplShowCursor( sal_True );
2000-09-18 16:07:07 +00:00
Invalidate();
}
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
if ( !mpSubEdit )
{
ImplInitSettings( sal_True, sal_False, sal_False );
2000-09-18 16:07:07 +00:00
ImplShowCursor();
Invalidate();
}
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
if ( !mpSubEdit )
{
ImplInitSettings( sal_False, sal_True, sal_False );
2000-09-18 16:07:07 +00:00
Invalidate();
}
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
if ( !mpSubEdit )
{
ImplInitSettings( sal_False, sal_False, sal_True );
2000-09-18 16:07:07 +00:00
Invalidate();
}
}
Control::StateChanged( nType );
}
// -----------------------------------------------------------------------
void Edit::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
(rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
if ( !mpSubEdit )
{
ImplInitSettings( sal_True, sal_True, sal_True );
ImplShowCursor( sal_True );
2000-09-18 16:07:07 +00:00
Invalidate();
}
}
Control::DataChanged( rDCEvt );
}
// -----------------------------------------------------------------------
void Edit::ImplShowDDCursor()
{
if ( !mpDDInfo->bVisCursor )
{
long nTextWidth = GetTextWidth( maText, 0, mpDDInfo->nDropPos );
long nTextHeight = GetTextHeight();
Rectangle aCursorRect( Point( nTextWidth + mnXOffset, (GetOutputSize().Height()-nTextHeight)/2 ), Size( 2, nTextHeight ) );
mpDDInfo->aCursor.SetWindow( this );
mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() );
mpDDInfo->aCursor.SetSize( aCursorRect.GetSize() );
mpDDInfo->aCursor.Show();
mpDDInfo->bVisCursor = sal_True;
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void Edit::ImplHideDDCursor()
{
if ( mpDDInfo && mpDDInfo->bVisCursor )
{
mpDDInfo->aCursor.Hide();
mpDDInfo->bVisCursor = sal_False;
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void Edit::Modify()
{
if ( mbIsSubEdit )
2000-09-18 16:07:07 +00:00
{
((Edit*)GetParent())->Modify();
}
else
{
if ( mpUpdateDataTimer )
mpUpdateDataTimer->Start();
if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, maModifyHdl, this ) )
// have been destroyed while calling into the handlers
return;
// #i13677# notify edit listeners about caret position change
ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
// FIXME: this is currently only on aqua
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( this );
}
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void Edit::UpdateData()
{
maUpdateDataHdl.Call( this );
}
// -----------------------------------------------------------------------
IMPL_LINK( Edit, ImplUpdateDataHdl, Timer*, EMPTYARG )
{
UpdateData();
return 0;
}
// -----------------------------------------------------------------------
void Edit::EnableUpdateData( sal_uLong nTimeout )
2000-09-18 16:07:07 +00:00
{
if ( !nTimeout )
DisableUpdateData();
else
{
if ( !mpUpdateDataTimer )
{
mpUpdateDataTimer = new Timer;
mpUpdateDataTimer->SetTimeoutHdl( LINK( this, Edit, ImplUpdateDataHdl ) );
}
mpUpdateDataTimer->SetTimeout( nTimeout );
}
}
// -----------------------------------------------------------------------
void Edit::SetEchoChar( xub_Unicode c )
{
mcEchoChar = c;
if ( mpSubEdit )
mpSubEdit->SetEchoChar( c );
}
// -----------------------------------------------------------------------
void Edit::SetReadOnly( sal_Bool bReadOnly )
2000-09-18 16:07:07 +00:00
{
if ( mbReadOnly != bReadOnly )
{
mbReadOnly = bReadOnly;
if ( mpSubEdit )
mpSubEdit->SetReadOnly( bReadOnly );
StateChanged( STATE_CHANGE_READONLY );
}
}
// -----------------------------------------------------------------------
void Edit::SetAutocompleteHdl( const Link& rHdl )
{
maAutocompleteHdl = rHdl;
if ( mpSubEdit )
mpSubEdit->SetAutocompleteHdl( rHdl );
}
// -----------------------------------------------------------------------
void Edit::SetInsertMode( sal_Bool bInsert )
2000-09-18 16:07:07 +00:00
{
if ( bInsert != mbInsertMode )
{
mbInsertMode = bInsert;
if ( mpSubEdit )
mpSubEdit->SetInsertMode( bInsert );
else
ImplShowCursor();
}
}
// -----------------------------------------------------------------------
sal_Bool Edit::IsInsertMode() const
2000-09-18 16:07:07 +00:00
{
if ( mpSubEdit )
return mpSubEdit->IsInsertMode();
else
return mbInsertMode;
}
// -----------------------------------------------------------------------
void Edit::SetMaxTextLen( xub_StrLen nMaxLen )
{
mnMaxTextLen = nMaxLen ? nMaxLen : EDIT_NOLIMIT;
if ( mpSubEdit )
mpSubEdit->SetMaxTextLen( mnMaxTextLen );
2000-09-18 16:07:07 +00:00
else
{
if ( maText.Len() > mnMaxTextLen )
ImplDelete( Selection( mnMaxTextLen, maText.Len() ), EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void Edit::SetSelection( const Selection& rSelection )
{
// Wenn von aussen z.B. im MouseButtonDown die Selektion geaendert wird,
// soll nicht gleich ein Tracking() zuschlagen und die Selektion aendern.
if ( IsTracking() )
EndTracking();
else if ( mpSubEdit && mpSubEdit->IsTracking() )
mpSubEdit->EndTracking();
ImplSetSelection( rSelection );
}
// -----------------------------------------------------------------------
void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint )
2000-09-18 16:07:07 +00:00
{
if ( mpSubEdit )
mpSubEdit->ImplSetSelection( rSelection );
else
{
if ( rSelection != maSelection )
{
Selection aOld( maSelection );
Selection aNew( rSelection );
if ( aNew.Min() > maText.Len() )
aNew.Min() = maText.Len();
if ( aNew.Max() > maText.Len() )
aNew.Max() = maText.Len();
if ( aNew.Min() < 0 )
aNew.Min() = 0;
if ( aNew.Max() < 0 )
aNew.Max() = 0;
if ( aNew != maSelection )
{
ImplClearLayoutData();
2000-09-18 16:07:07 +00:00
maSelection = aNew;
if ( bPaint && ( aOld.Len() || aNew.Len() || IsPaintTransparent() ) )
ImplInvalidateOrRepaint( 0, maText.Len() );
2000-09-18 16:07:07 +00:00
ImplShowCursor();
if ( mbIsSubEdit )
((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
else
ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
// #103511# notify combobox listeners of deselection
if( !maSelection && GetParent() && GetParent()->GetType() == WINDOW_COMBOBOX )
((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_COMBOBOX_DESELECT );
2000-09-18 16:07:07 +00:00
}
}
}
}
// -----------------------------------------------------------------------
const Selection& Edit::GetSelection() const
{
if ( mpSubEdit )
return mpSubEdit->GetSelection();
else
return maSelection;
}
// -----------------------------------------------------------------------
void Edit::ReplaceSelected( const XubString& rStr )
{
if ( mpSubEdit )
mpSubEdit->ReplaceSelected( rStr );
else
ImplInsertText( rStr );
}
// -----------------------------------------------------------------------
void Edit::DeleteSelected()
{
if ( mpSubEdit )
mpSubEdit->DeleteSelected();
else
{
if ( maSelection.Len() )
ImplDelete( maSelection, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
}
}
// -----------------------------------------------------------------------
XubString Edit::GetSelected() const
{
if ( mpSubEdit )
return mpSubEdit->GetSelected();
else
{
Selection aSelection( maSelection );
aSelection.Justify();
return maText.Copy( (xub_StrLen)aSelection.Min(), (xub_StrLen)aSelection.Len() );
}
}
// -----------------------------------------------------------------------
void Edit::Cut()
{
if ( !(GetStyle() & WB_PASSWORD ) )
{
Copy();
ReplaceSelected( ImplGetSVEmptyStr() );
}
}
// -----------------------------------------------------------------------
void Edit::Copy()
{
if ( !(GetStyle() & WB_PASSWORD ) )
{
::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipboard(GetClipboard());
ImplCopy( aClipboard );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void Edit::Paste()
{
::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipboard(GetClipboard());
ImplPaste( aClipboard );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::Undo()
{
if ( mpSubEdit )
mpSubEdit->Undo();
else
{
XubString aText( maText );
ImplDelete( Selection( 0, aText.Len() ), EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
ImplInsertText( maUndoText );
ImplSetSelection( Selection( 0, maUndoText.Len() ) );
maUndoText = aText;
}
}
// -----------------------------------------------------------------------
void Edit::SetText( const XubString& rStr )
{
if ( mpSubEdit )
mpSubEdit->SetText( rStr ); // Nicht direkt ImplSetText, falls SetText ueberladen
else
{
Selection aNewSel( 0, 0 ); // Damit nicht gescrollt wird
ImplSetText( rStr, &aNewSel );
}
}
// -----------------------------------------------------------------------
void Edit::SetText( const XubString& rStr, const Selection& rSelection )
{
if ( mpSubEdit )
mpSubEdit->SetText( rStr, rSelection );
else
ImplSetText( rStr, &rSelection );
}
// -----------------------------------------------------------------------
XubString Edit::GetText() const
{
if ( mpSubEdit )
return mpSubEdit->GetText();
else
return maText;
}
// -----------------------------------------------------------------------
void Edit::SetModifyFlag()
{
if ( mpSubEdit )
mpSubEdit->mbModified = sal_True;
2000-09-18 16:07:07 +00:00
else
mbModified = sal_True;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::ClearModifyFlag()
{
if ( mpSubEdit )
mpSubEdit->mbModified = sal_False;
2000-09-18 16:07:07 +00:00
else
mbModified = sal_False;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void Edit::SetSubEdit( Edit* pEdit )
{
mpSubEdit = pEdit;
if ( mpSubEdit )
{
SetPointer( POINTER_ARROW ); // Nur das SubEdit hat den BEAM...
mpSubEdit->mbIsSubEdit = sal_True;
mpSubEdit->SetReadOnly( mbReadOnly );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
Size Edit::CalcMinimumSize() const
{
Size aSize ( GetTextWidth( GetText() ), GetTextHeight() );
2009-05-27 17:40:24 +00:00
// do not create edit fields in which one cannot enter anything
// a default minimum width should exist for at least 3 characters
Size aMinSize ( CalcSize( 3 ) );
if( aSize.Width() < aMinSize.Width() )
aSize.Width() = aMinSize.Width();
// add some space between text entry and border
2009-08-31 16:08:23 +00:00
aSize.Height() += 4;
2009-08-07 12:32:48 +00:00
aSize = CalcWindowSize( aSize );
// ask NWF what if it has an opinion, too
ImplControlValue aControlValue;
Rectangle aRect( Point( 0, 0 ), aSize );
Rectangle aContent, aBound;
2009-08-07 12:32:48 +00:00
if( const_cast<Edit*>(this)->GetNativeControlRegion(
CTRL_EDITBOX, PART_ENTIRE_CONTROL,
aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
if( aBound.GetHeight() > aSize.Height() )
aSize.Height() = aBound.GetHeight();
2009-08-07 12:32:48 +00:00
}
return aSize;
}
Size Edit::GetMinimumEditSize()
{
Window* pDefWin = ImplGetDefaultWindow();
Edit aEdit( pDefWin, WB_BORDER );
Size aSize( aEdit.CalcMinimumSize() );
return aSize;
}
// -----------------------------------------------------------------------
Size Edit::GetOptimalSize(WindowSizeType eType) const
{
switch (eType) {
case WINDOWSIZE_MINIMUM:
return CalcMinimumSize();
default:
return Control::GetOptimalSize( eType );
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Size Edit::CalcSize( xub_StrLen nChars ) const
{
// Breite fuer n Zeichen, unabhaengig vom Inhalt.
// Funktioniert nur bei FixedFont richtig, sonst Mittelwert.
Size aSz( GetTextWidth( XubString( 'x' ) ), GetTextHeight() );
aSz.Width() *= nChars;
aSz = CalcWindowSize( aSz );
return aSz;
}
// -----------------------------------------------------------------------
xub_StrLen Edit::GetMaxVisChars() const
{
const Window* pW = mpSubEdit ? mpSubEdit : this;
long nOutWidth = pW->GetOutputSizePixel().Width();
long nCharWidth = GetTextWidth( XubString( 'x' ) );
return nCharWidth ? (xub_StrLen)(nOutWidth/nCharWidth) : 0;
}
// -----------------------------------------------------------------------
xub_StrLen Edit::GetCharPos( const Point& rWindowPos ) const
{
return ImplGetCharPos( rWindowPos );
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void Edit::SetGetSpecialCharsFunction( FncGetSpecialChars fn )
{
pImplFncGetSpecialChars = fn;
}
// -----------------------------------------------------------------------
FncGetSpecialChars Edit::GetGetSpecialCharsFunction()
{
return pImplFncGetSpecialChars;
}
// -----------------------------------------------------------------------
PopupMenu* Edit::CreatePopupMenu()
{
ResMgr* pResMgr = ImplGetResMgr();
if( ! pResMgr )
return new PopupMenu();
PopupMenu* pPopup = new PopupMenu( ResId( SV_RESID_MENU_EDIT, *pResMgr ) );
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
if ( rStyleSettings.GetAcceleratorsInContextMenus() )
{
pPopup->SetAccelKey( SV_MENU_EDIT_UNDO, KeyCode( KEYFUNC_UNDO ) );
pPopup->SetAccelKey( SV_MENU_EDIT_CUT, KeyCode( KEYFUNC_CUT ) );
pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, sal_False, sal_True, sal_False, sal_False ) );
pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, sal_True, sal_True, sal_False, sal_False ) );
}
2000-09-18 16:07:07 +00:00
return pPopup;
}
// -----------------------------------------------------------------------
void Edit::DeletePopupMenu( PopupMenu* pMenu )
{
delete pMenu;
}
2001-05-11 06:26:03 +00:00
// ::com::sun::star::datatransfer::dnd::XDragGestureListener
void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw (::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aVclGuard;
2001-05-11 06:26:03 +00:00
if ( !IsTracking() && maSelection.Len() &&
!(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == sal_False) ) // Kein Mehrfach D&D
2001-05-11 06:26:03 +00:00
{
Selection aSel( maSelection );
aSel.Justify();
// Nur wenn Maus in der Selektion...
Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY );
xub_StrLen nChar = ImplGetCharPos( aMousePos );
if ( (nChar >= aSel.Min()) && (nChar < aSel.Max()) )
{
if ( !mpDDInfo )
mpDDInfo = new DDInfo;
mpDDInfo->bStarterOfDD = sal_True;
2001-05-11 06:26:03 +00:00
mpDDInfo->aDndStartSel = aSel;
if ( IsTracking() )
EndTracking(); // Vor D&D Tracking ausschalten
::vcl::unohelper::TextDataObject* pDataObj = new ::vcl::unohelper::TextDataObject( GetSelected() );
2001-10-23 11:38:57 +00:00
sal_Int8 nActions = datatransfer::dnd::DNDConstants::ACTION_COPY;
if ( !IsReadOnly() )
nActions |= datatransfer::dnd::DNDConstants::ACTION_MOVE;
rDGE.DragSource->startDrag( rDGE, nActions, 0 /*cursor*/, 0 /*image*/, pDataObj, mxDnDListener );
if ( GetCursor() )
GetCursor()->Hide();
2001-05-11 06:26:03 +00:00
}
}
}
// ::com::sun::star::datatransfer::dnd::XDragSourceListener
void Edit::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& rDSDE ) throw (::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aVclGuard;
2001-05-11 06:26:03 +00:00
2001-10-23 11:38:57 +00:00
if ( rDSDE.DropSuccess && ( rDSDE.DropAction & datatransfer::dnd::DNDConstants::ACTION_MOVE ) )
2001-05-11 06:26:03 +00:00
{
Selection aSel( mpDDInfo->aDndStartSel );
if ( mpDDInfo->bDroppedInMe )
{
if ( aSel.Max() > mpDDInfo->nDropPos )
{
long nLen = aSel.Len();
aSel.Min() += nLen;
aSel.Max() += nLen;
}
}
ImplDelete( aSel, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
ImplModified();
}
ImplHideDDCursor();
delete mpDDInfo;
mpDDInfo = NULL;
}
// ::com::sun::star::datatransfer::dnd::XDropTargetListener
void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aVclGuard;
2001-05-11 06:26:03 +00:00
sal_Bool bChanges = sal_False;
2001-05-11 06:26:03 +00:00
if ( !mbReadOnly && mpDDInfo )
{
ImplHideDDCursor();
Selection aSel( maSelection );
aSel.Justify();
if ( aSel.Len() && !mpDDInfo->bStarterOfDD )
ImplDelete( aSel, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
mpDDInfo->bDroppedInMe = sal_True;
2001-05-11 06:26:03 +00:00
aSel.Min() = mpDDInfo->nDropPos;
aSel.Max() = mpDDInfo->nDropPos;
ImplSetSelection( aSel );
uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
if ( xDataObj.is() )
{
datatransfer::DataFlavor aFlavor;
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor );
if ( xDataObj->isDataFlavorSupported( aFlavor ) )
{
uno::Any aData = xDataObj->getTransferData( aFlavor );
::rtl::OUString aText;
aData >>= aText;
ImplInsertText( aText );
bChanges = sal_True;
2001-05-11 06:26:03 +00:00
ImplModified();
}
}
if ( !mpDDInfo->bStarterOfDD )
{
delete mpDDInfo;
mpDDInfo = NULL;
}
}
rDTDE.Context->dropComplete( bChanges );
}
void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
2001-05-11 06:26:03 +00:00
{
2001-08-08 09:40:38 +00:00
if ( !mpDDInfo )
{
mpDDInfo = new DDInfo;
}
// search for string data type
const Sequence< com::sun::star::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
sal_Int32 nEle = rFlavors.getLength();
mpDDInfo->bIsStringSupported = sal_False;
for( sal_Int32 i = 0; i < nEle; i++ )
{
sal_Int32 nIndex = 0;
rtl::OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex );
if( aMimetype.equalsAscii( "text/plain" ) )
{
mpDDInfo->bIsStringSupported = sal_True;
break;
}
}
2001-05-11 06:26:03 +00:00
}
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
2001-05-11 06:26:03 +00:00
{
SolarMutexGuard aVclGuard;
2001-05-11 06:26:03 +00:00
ImplHideDDCursor();
}
void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aVclGuard;
2001-05-11 06:26:03 +00:00
Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
xub_StrLen nPrevDropPos = mpDDInfo->nDropPos;
mpDDInfo->nDropPos = ImplGetCharPos( aMousePos );
2001-10-23 11:38:57 +00:00
/*
2001-05-11 06:26:03 +00:00
Size aOutSize = GetOutputSizePixel();
if ( ( aMousePos.X() < 0 ) || ( aMousePos.X() > aOutSize.Width() ) )
{
2001-10-23 11:38:57 +00:00
// Scroll?
// No, I will not receive events in this case....
2001-05-11 06:26:03 +00:00
}
2001-10-23 11:38:57 +00:00
*/
2001-05-11 06:26:03 +00:00
Selection aSel( maSelection );
aSel.Justify();
2001-10-23 11:38:57 +00:00
// Don't accept drop in selection or read-only field...
if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported )
2001-05-11 06:26:03 +00:00
{
ImplHideDDCursor();
rDTDE.Context->rejectDrag();
}
else
{
// Alten Cursor wegzeichnen...
if ( !mpDDInfo->bVisCursor || ( nPrevDropPos != mpDDInfo->nDropPos ) )
{
ImplHideDDCursor();
ImplShowDDCursor();
}
2001-08-08 09:40:38 +00:00
rDTDE.Context->acceptDrag( rDTDE.DropAction );
2001-05-11 06:26:03 +00:00
}
}
2000-09-18 16:07:07 +00:00
ImplSubEdit::ImplSubEdit( Edit* pParent, WinBits nStyle ) :
Edit( pParent, nStyle )
{
pParent->SetSubEdit( this );
}
// -----------------------------------------------------------------------
void ImplSubEdit::Modify()
{
GetParent()->Modify();
}
2008-10-29 09:25:50 +00:00
XubString Edit::GetSurroundingText() const
{
if ( mpSubEdit )
return mpSubEdit->GetSurroundingText();
else
return maText;
}
Selection Edit::GetSurroundingTextSelection() const
{
return GetSelection();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */