Files
libreoffice/sw/source/core/edit/edws.cxx

362 lines
9.5 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 23:08:29 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 23:08:29 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 23:08:29 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 23:08:29 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 23:08:29 +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 23:08:29 +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 23:08:29 +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 23:08:29 +00:00
*
************************************************************************/
2000-09-18 23:08:29 +00:00
#include <vcl/window.hxx>
2000-09-18 23:08:29 +00:00
#include <editsh.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
2000-09-18 23:08:29 +00:00
#include <pam.hxx>
#include <docary.hxx>
#include <acorrect.hxx>
#include <swtable.hxx>
#include <ndtxt.hxx>
#include <swundo.hxx>
#include <SwRewriter.hxx>
2000-09-18 23:08:29 +00:00
/********************************************************
* Ctor/Dtor
********************************************************/
// verkleideter Copy-Constructor
SwEditShell::SwEditShell( SwEditShell& rEdSH, Window *pWindow )
: SwCrsrShell( rEdSH, pWindow )
2000-09-18 23:08:29 +00:00
{
}
// ctor/dtor
SwEditShell::SwEditShell( SwDoc& rDoc, Window *pWindow, const SwViewOption *pOptions )
: SwCrsrShell( rDoc, pWindow, pOptions )
2000-09-18 23:08:29 +00:00
{
GetDoc()->GetIDocumentUndoRedo().DoUndo(true);
2000-09-18 23:08:29 +00:00
}
SwEditShell::~SwEditShell() // USED
{
}
/******************************************************************************
* sal_Bool SwEditShell::IsModified() const
******************************************************************************/
sal_Bool SwEditShell::IsModified() const
{
return GetDoc()->IsModified();
}
/******************************************************************************
* void SwEditShell::SetModified()
******************************************************************************/
void SwEditShell::SetModified()
{
GetDoc()->SetModified();
}
/******************************************************************************
* void SwEditShell::ResetModified()
******************************************************************************/
void SwEditShell::ResetModified()
{
GetDoc()->ResetModified();
}
void SwEditShell::SetUndoNoResetModified()
{
GetDoc()->SetModified();
GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
2000-09-18 23:08:29 +00:00
}
/******************************************************************************
* void SwEditShell::StartAllAction()
******************************************************************************/
void SwEditShell::StartAllAction()
{
ViewShell *pSh = this;
do {
if( pSh->IsA( TYPE( SwEditShell ) ) )
((SwEditShell*)pSh)->StartAction();
else
pSh->StartAction();
pSh = (ViewShell *)pSh->GetNext();
} while(pSh != this);
}
/******************************************************************************
* void SwEditShell::EndAllAction()
******************************************************************************/
void SwEditShell::EndAllAction()
{
ViewShell *pSh = this;
do {
if( pSh->IsA( TYPE( SwEditShell ) ) )
((SwEditShell*)pSh)->EndAction();
else
pSh->EndAction();
pSh = (ViewShell *)pSh->GetNext();
} while(pSh != this);
}
/******************************************************************************
* void SwEditShell::CalcLayout()
******************************************************************************/
void SwEditShell::CalcLayout()
{
StartAllAction();
ViewShell::CalcLayout();
ViewShell *pSh = this;
do
{
if ( pSh->GetWin() )
pSh->GetWin()->Invalidate();
pSh = (ViewShell*)pSh->GetNext();
} while ( pSh != this );
EndAllAction();
}
/******************************************************************************
* Inhaltsform bestimmen, holen
******************************************************************************/
// OPT: wird fuer jedes Attribut gerufen?
sal_uInt16 SwEditShell::GetCntType() const
{
// nur noch am SPoint ist der Inhalt interessant
sal_uInt16 nRet = 0;
if( IsTableMode() )
nRet = CNT_TXT;
else
switch( GetCrsr()->GetNode()->GetNodeType() )
{
case ND_TEXTNODE: nRet = CNT_TXT; break;
case ND_GRFNODE: nRet = CNT_GRF; break;
case ND_OLENODE: nRet = CNT_OLE; break;
}
2011-02-20 17:58:46 +01:00
OSL_ASSERT( nRet );
2000-09-18 23:08:29 +00:00
return nRet;
}
//------------------------------------------------------------------------------
sal_Bool SwEditShell::HasOtherCnt() const
2000-09-18 23:08:29 +00:00
{
if ( !GetDoc()->GetSpzFrmFmts()->empty() )
CWS-TOOLING: integrate CWS bjm02 2009-08-12 Bjoern Michaelsen #i101879# moved officeversion from envelope body to requestbody 2009-08-11 Bjoern Michaelsen #i103732# reverting changeset f3f527950572 2009-08-10 Bjoern Michaelsen cws bjm02: merging local minibranches 2009-08-10 Bjoern Michaelsen #i104128# remove additional duplication in svx headers, remove license header merge conflicts in svx headers 2009-08-10 Bjoern Michaelsen #i100484# fixed buildbreaker on win32 2009-08-10 Bjoern Michaelsen #i104128# remove duplication in svx headers 2009-08-04 Bjoern Michaelsen #i103913# fixed bookmark updating when moving numbered para 2009-08-03 Bjoern Michaelsen #i101879# include officeversion/productname in soaprequest 2009-07-31 Bjoern Michaelsen #i84926# Selecting all in blockmode automatically falls back to std mode 2009-07-31 Bjoern Michaelsen #i100484# operation on 'pCmpLine' may be undefined, thanks cmc 2009-07-29 Bjoern Michaelsen #i103059# fixing crash on empty enumeration 2009-07-29 Bjoern Michaelsen #i98659# fixing typo in usagetracking option tabpage 2009-07-29 Bjoern Michaelsen #i103732# not triggering loading of oooimprovement dll if usage tracking is disabled 2009-07-29 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators, fixing used type in xmloff 2009-07-29 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators 2009-07-29 Bjoern Michaelsen #i103182# completely removing unused functions in extensions/oooimprovement 2009-07-28 Bjoern Michaelsen cws bjm02: merged changes from master up to milestone DEV300_m53 2009-06-29 Bjoern Michaelsen #i103182# commenting out getFailedAttempts(..) for future use 2009-06-29 Bjoern Michaelsen #i103183# removed unused function sw::mark::CrossRefBookmark::IsLegalName(..) 2009-06-29 Bjoern Michaelsen #i103182# removing unused functions in extensions/oooimprovement 2009-06-24 Bjoern Michaelsen #i103059# not using enumeration for getByName/getByIndex 2009-06-24 Bjoern Michaelsen #i103059# not using enumeration for hasByName/GetCount/hasElements for performance reasons 2009-06-24 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators 2009-08-27 releng CWS-TOOLING: integrate CWS hr65 2009-08-26 Jens-Heiner Rechtien #i104521#: implement 'setcurrent'; document --hg option to 'create' 2009-08-26 Jens-Heiner Rechtien #i104521#: SOAP method setSCMName() doesn't return a value 2009-08-26 Jens-Heiner Rechtien #i104521#: implement [set|get]_scm() 2009-08-26 Jens-Heiner Rechtien #i104521#: implement --hg switch to 'cws create' 2009-08-27 vg CWS-TOOLING: integrate CWS hr64_DEV300 2009-07-21 13:24:57 +0200 hr r274189 : #i99576#: re-enable optimization for tabcont.cxx 2009-07-21 13:17:18 +0200 hr r274188 : #i99592: disable -xspace optimization for Solaris x86 and SunStudio 12, due to some mis-optimzation in sc and elsewhere. SunStudio 12 update 1 is OK, but needs a few unrelated changes which will be implemented in DEV300 code line 2009-08-27 releng CWS-TOOLING: integrate CWS sw32bf02 2009-08-25 15:52:04 +0200 hde r275366 : reactived testcases hit by issue 102752 2009-08-21 13:52:17 +0200 od r275245 : #i102921# delete files whose deletion has been forgotten in cws impress172 2009-08-21 11:20:47 +0200 od r275225 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@275001 (milestone: DEV300:m55) 2009-08-20 16:21:30 +0200 od r275191 : #i92511# method <lcl_MoveAllLowerObjs(..)> - invalidation of cache for object rectangle inclusive spaces is needed. 2009-08-20 15:50:40 +0200 od r275188 : #i96726# method <SwPagePreView::DocSzChgd(..)> - trigger recalculation of page preview layout even if the count of pages is not changing 2009-08-20 12:37:32 +0200 od r275172 : #i100466# correction for showing and hiding redlines 2009-08-18 13:25:18 +0200 od r275100 : #i103817# method <XMLTextImportHelper::SetStyleAndAttrs(..) - assure that a heading applies the outline style, if no other list style is applied. 2009-08-18 13:21:38 +0200 od r275098 : #i103817# allow the outline style - list style for outline numbering - to be set directly at the paragraph 2009-08-17 14:13:02 +0200 od r275052 : #i103684# add missing documentation for new optional OutlineLevel attribute introduced in OOo 3.1 2009-08-17 14:00:25 +0200 od r275049 : #i100481# method <XMLTextFrameContext_Impl::CreateChildContext(..)># - correct condition for handling embedded documents and embedded math objects 2009-08-12 14:11:34 +0200 od r274891 : #i97379# assure that columns are not applied to fly frames, which represent graphics or embedded objects 2009-08-12 12:51:43 +0200 od r274889 : #i101870# method <SwTxtNode::_MakeNewTxtNode(..)> - perform action on different paragraph styles before applying new paragraph style 2009-08-12 12:24:44 +0200 od r274888 : #i101092# method <ViewShell::Paint(..)> - encapsulate paint of document background and document into pre and post drawing layer paint calls 2009-08-12 11:38:48 +0200 od r274886 : #i98766# minor adjustment in order to be warning free under Mac port builds 2009-08-12 11:33:54 +0200 od r274885 : #i99267# method <SwTabFrm::MakeAll()> - reset <bSplit> after forward move to assure that follows can be joined, if further space is available. 2009-08-12 11:11:49 +0200 od r274882 : #i98766# method <ViewShell::SmoothScroll(..) - disable smooth scroll for Mac port builds 2009-08-10 12:17:58 +0200 od r274801 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@274622 (milestone: DEV300:m54) 2009-07-21 16:56:45 +0200 od r274206 : #i103685# method <SwTxtFormatter::NewTabPortion(..)> - adjust condition to apply automatic tab stop at left margin correctly in case that tab stops are not relative to indent 2009-07-10 11:53:53 +0200 od r273883 : #i102752 method <SwDrawContact::Modify(..)> - assure that a ShapePropertyChangeNotifier exists 2009-07-07 12:01:58 +0200 mst r273788 : #i103304# apply patch by dtardon to fix bogus conditional 2009-07-07 09:01:13 +0200 od r273767 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@273468 (milestone: DEV300:m51) 2009-08-27 vg CWS-TOOLING: integrate CWS native264_DEV300 2009-08-13 11:58:58 +0200 is r274928 : #i104200# update to jre6u16 2009-08-27 vg CWS-TOOLING: integrate CWS automationdev300m54tables 2009-08-14 13:01:05 +0200 wg r274976 : i104224 2009-08-14 13:00:28 +0200 wg r274975 : i104224 2009-08-14 12:12:34 +0200 wg r274974 : i104222 2009-08-13 14:28:13 +0200 wg r274944 : i104205 2009-08-13 14:27:40 +0200 wg r274943 : i104205 2009-08-13 14:26:36 +0200 wg r274942 : i104205
2009-08-27 15:54:55 +00:00
return sal_True;
2000-09-18 23:08:29 +00:00
const SwNodes &rNds = GetDoc()->GetNodes();
const SwNode *pNd;
CWS-TOOLING: integrate CWS bjm02 2009-08-12 Bjoern Michaelsen #i101879# moved officeversion from envelope body to requestbody 2009-08-11 Bjoern Michaelsen #i103732# reverting changeset f3f527950572 2009-08-10 Bjoern Michaelsen cws bjm02: merging local minibranches 2009-08-10 Bjoern Michaelsen #i104128# remove additional duplication in svx headers, remove license header merge conflicts in svx headers 2009-08-10 Bjoern Michaelsen #i100484# fixed buildbreaker on win32 2009-08-10 Bjoern Michaelsen #i104128# remove duplication in svx headers 2009-08-04 Bjoern Michaelsen #i103913# fixed bookmark updating when moving numbered para 2009-08-03 Bjoern Michaelsen #i101879# include officeversion/productname in soaprequest 2009-07-31 Bjoern Michaelsen #i84926# Selecting all in blockmode automatically falls back to std mode 2009-07-31 Bjoern Michaelsen #i100484# operation on 'pCmpLine' may be undefined, thanks cmc 2009-07-29 Bjoern Michaelsen #i103059# fixing crash on empty enumeration 2009-07-29 Bjoern Michaelsen #i98659# fixing typo in usagetracking option tabpage 2009-07-29 Bjoern Michaelsen #i103732# not triggering loading of oooimprovement dll if usage tracking is disabled 2009-07-29 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators, fixing used type in xmloff 2009-07-29 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators 2009-07-29 Bjoern Michaelsen #i103182# completely removing unused functions in extensions/oooimprovement 2009-07-28 Bjoern Michaelsen cws bjm02: merged changes from master up to milestone DEV300_m53 2009-06-29 Bjoern Michaelsen #i103182# commenting out getFailedAttempts(..) for future use 2009-06-29 Bjoern Michaelsen #i103183# removed unused function sw::mark::CrossRefBookmark::IsLegalName(..) 2009-06-29 Bjoern Michaelsen #i103182# removing unused functions in extensions/oooimprovement 2009-06-24 Bjoern Michaelsen #i103059# not using enumeration for getByName/getByIndex 2009-06-24 Bjoern Michaelsen #i103059# not using enumeration for hasByName/GetCount/hasElements for performance reasons 2009-06-24 Bjoern Michaelsen #i103036# stlunosequence can be use simple array-pointers as iterators 2009-08-27 releng CWS-TOOLING: integrate CWS hr65 2009-08-26 Jens-Heiner Rechtien #i104521#: implement 'setcurrent'; document --hg option to 'create' 2009-08-26 Jens-Heiner Rechtien #i104521#: SOAP method setSCMName() doesn't return a value 2009-08-26 Jens-Heiner Rechtien #i104521#: implement [set|get]_scm() 2009-08-26 Jens-Heiner Rechtien #i104521#: implement --hg switch to 'cws create' 2009-08-27 vg CWS-TOOLING: integrate CWS hr64_DEV300 2009-07-21 13:24:57 +0200 hr r274189 : #i99576#: re-enable optimization for tabcont.cxx 2009-07-21 13:17:18 +0200 hr r274188 : #i99592: disable -xspace optimization for Solaris x86 and SunStudio 12, due to some mis-optimzation in sc and elsewhere. SunStudio 12 update 1 is OK, but needs a few unrelated changes which will be implemented in DEV300 code line 2009-08-27 releng CWS-TOOLING: integrate CWS sw32bf02 2009-08-25 15:52:04 +0200 hde r275366 : reactived testcases hit by issue 102752 2009-08-21 13:52:17 +0200 od r275245 : #i102921# delete files whose deletion has been forgotten in cws impress172 2009-08-21 11:20:47 +0200 od r275225 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@275001 (milestone: DEV300:m55) 2009-08-20 16:21:30 +0200 od r275191 : #i92511# method <lcl_MoveAllLowerObjs(..)> - invalidation of cache for object rectangle inclusive spaces is needed. 2009-08-20 15:50:40 +0200 od r275188 : #i96726# method <SwPagePreView::DocSzChgd(..)> - trigger recalculation of page preview layout even if the count of pages is not changing 2009-08-20 12:37:32 +0200 od r275172 : #i100466# correction for showing and hiding redlines 2009-08-18 13:25:18 +0200 od r275100 : #i103817# method <XMLTextImportHelper::SetStyleAndAttrs(..) - assure that a heading applies the outline style, if no other list style is applied. 2009-08-18 13:21:38 +0200 od r275098 : #i103817# allow the outline style - list style for outline numbering - to be set directly at the paragraph 2009-08-17 14:13:02 +0200 od r275052 : #i103684# add missing documentation for new optional OutlineLevel attribute introduced in OOo 3.1 2009-08-17 14:00:25 +0200 od r275049 : #i100481# method <XMLTextFrameContext_Impl::CreateChildContext(..)># - correct condition for handling embedded documents and embedded math objects 2009-08-12 14:11:34 +0200 od r274891 : #i97379# assure that columns are not applied to fly frames, which represent graphics or embedded objects 2009-08-12 12:51:43 +0200 od r274889 : #i101870# method <SwTxtNode::_MakeNewTxtNode(..)> - perform action on different paragraph styles before applying new paragraph style 2009-08-12 12:24:44 +0200 od r274888 : #i101092# method <ViewShell::Paint(..)> - encapsulate paint of document background and document into pre and post drawing layer paint calls 2009-08-12 11:38:48 +0200 od r274886 : #i98766# minor adjustment in order to be warning free under Mac port builds 2009-08-12 11:33:54 +0200 od r274885 : #i99267# method <SwTabFrm::MakeAll()> - reset <bSplit> after forward move to assure that follows can be joined, if further space is available. 2009-08-12 11:11:49 +0200 od r274882 : #i98766# method <ViewShell::SmoothScroll(..) - disable smooth scroll for Mac port builds 2009-08-10 12:17:58 +0200 od r274801 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@274622 (milestone: DEV300:m54) 2009-07-21 16:56:45 +0200 od r274206 : #i103685# method <SwTxtFormatter::NewTabPortion(..)> - adjust condition to apply automatic tab stop at left margin correctly in case that tab stops are not relative to indent 2009-07-10 11:53:53 +0200 od r273883 : #i102752 method <SwDrawContact::Modify(..)> - assure that a ShapePropertyChangeNotifier exists 2009-07-07 12:01:58 +0200 mst r273788 : #i103304# apply patch by dtardon to fix bogus conditional 2009-07-07 09:01:13 +0200 od r273767 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@273468 (milestone: DEV300:m51) 2009-08-27 vg CWS-TOOLING: integrate CWS native264_DEV300 2009-08-13 11:58:58 +0200 is r274928 : #i104200# update to jre6u16 2009-08-27 vg CWS-TOOLING: integrate CWS automationdev300m54tables 2009-08-14 13:01:05 +0200 wg r274976 : i104224 2009-08-14 13:00:28 +0200 wg r274975 : i104224 2009-08-14 12:12:34 +0200 wg r274974 : i104222 2009-08-13 14:28:13 +0200 wg r274944 : i104205 2009-08-13 14:27:40 +0200 wg r274943 : i104205 2009-08-13 14:26:36 +0200 wg r274942 : i104205
2009-08-27 15:54:55 +00:00
pNd = &rNds.GetEndOfInserts();
if ( 1 != (pNd->GetIndex() - pNd->StartOfSectionIndex()) )
return sal_True;
pNd = &rNds.GetEndOfAutotext();
if ( 1 != (pNd->GetIndex() - pNd->StartOfSectionIndex()) )
return sal_True;
return sal_False;
2000-09-18 23:08:29 +00:00
}
/******************************************************************************
* Zugriffsfunktionen fuer Filename-Behandlung
******************************************************************************/
SwActContext::SwActContext(SwEditShell *pShell)
2000-09-18 23:08:29 +00:00
: pSh(pShell)
{
pSh->StartAction();
}
SwActContext::~SwActContext()
2000-09-18 23:08:29 +00:00
{
pSh->EndAction();
}
SwMvContext::SwMvContext(SwEditShell *pShell)
: pSh(pShell)
2000-09-18 23:08:29 +00:00
{
pSh->SttCrsrMove();
}
SwMvContext::~SwMvContext()
2000-09-18 23:08:29 +00:00
{
pSh->EndCrsrMove();
}
SwFrmFmt *SwEditShell::GetTableFmt() // OPT: schnellster Test auf Tabelle?
{
const SwTableNode* pTblNd = IsCrsrInTbl();
return pTblNd ? (SwFrmFmt*)pTblNd->GetTable().GetFrmFmt() : 0;
}
// OPT: wieso 3x beim neuen Dokument
sal_uInt16 SwEditShell::GetTOXTypeCount(TOXTypes eTyp) const
{
return pDoc->GetTOXTypeCount(eTyp);
}
void SwEditShell::InsertTOXType(const SwTOXType& rTyp)
{
pDoc->InsertTOXType(rTyp);
}
void SwEditShell::DoUndo( sal_Bool bOn )
{ GetDoc()->GetIDocumentUndoRedo().DoUndo( bOn ); }
2000-09-18 23:08:29 +00:00
sal_Bool SwEditShell::DoesUndo() const
{ return GetDoc()->GetIDocumentUndoRedo().DoesUndo(); }
2000-09-18 23:08:29 +00:00
void SwEditShell::DoGroupUndo( sal_Bool bOn )
{ GetDoc()->GetIDocumentUndoRedo().DoGroupUndo( bOn ); }
2000-09-18 23:08:29 +00:00
sal_Bool SwEditShell::DoesGroupUndo() const
{ return GetDoc()->GetIDocumentUndoRedo().DoesGroupUndo(); }
2000-09-18 23:08:29 +00:00
void SwEditShell::DelAllUndoObj()
{
GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
2000-09-18 23:08:29 +00:00
}
// Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
// Charaktern. Default ist sdbcx::Group-Undo.
// setzt Undoklammerung auf, liefert nUndoId der Klammerung
SwUndoId SwEditShell::StartUndo( SwUndoId eUndoId,
const SwRewriter *pRewriter )
{ return GetDoc()->GetIDocumentUndoRedo().StartUndo( eUndoId, pRewriter ); }
2000-09-18 23:08:29 +00:00
// schliesst Klammerung der nUndoId, nicht vom UI benutzt
SwUndoId SwEditShell::EndUndo(SwUndoId eUndoId,
const SwRewriter *pRewriter)
{ return GetDoc()->GetIDocumentUndoRedo().EndUndo(eUndoId, pRewriter); }
2000-09-18 23:08:29 +00:00
bool SwEditShell::GetLastUndoInfo(::rtl::OUString *const o_pStr,
SwUndoId *const o_pId) const
{ return GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(o_pStr, o_pId); }
2000-09-18 23:08:29 +00:00
bool SwEditShell::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
{ return GetDoc()->GetIDocumentUndoRedo().GetFirstRedoInfo(o_pStr); }
2000-09-18 23:08:29 +00:00
SwUndoId SwEditShell::GetRepeatInfo(::rtl::OUString *const o_pStr) const
{ return GetDoc()->GetIDocumentUndoRedo().GetRepeatInfo(o_pStr); }
2000-09-18 23:08:29 +00:00
// AutoKorrektur - JP 27.01.94
void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert,
sal_Unicode cChar )
{
SET_CURR_SHELL( this );
StartAllAction();
SwPaM* pCrsr = getShellCrsr( true );
2000-09-18 23:08:29 +00:00
SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode();
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar );
rACorr.AutoCorrect( aSwAutoCorrDoc,
pTNd->GetTxt(), pCrsr->GetPoint()->nContent.GetIndex(),
cChar, bInsert, GetWin() );
2000-09-18 23:08:29 +00:00
if( cChar )
SaveTblBoxCntnt( pCrsr->GetPoint() );
EndAllAction();
}
void SwEditShell::SetNewDoc(sal_Bool bNew)
{
GetDoc()->SetNewDoc(bNew);
}
sal_Bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, String& rWord )
{
SET_CURR_SHELL( this );
sal_Bool bRet;
SwPaM* pCrsr = getShellCrsr( true );
2000-09-18 23:08:29 +00:00
xub_StrLen nPos = pCrsr->GetPoint()->nContent.GetIndex();
SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode();
if( pTNd && nPos )
{
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, 0 );
bRet = rACorr.GetPrevAutoCorrWord( aSwAutoCorrDoc,
pTNd->GetTxt(), nPos, rWord );
}
else
bRet = sal_False;
return bRet;
}
SwAutoCompleteWord& SwEditShell::GetAutoCompleteWords()
{
return SwDoc::GetAutoCompleteWords();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */