summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unoobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore/unoobj.cxx')
-rw-r--r--sw/source/core/unocore/unoobj.cxx75
1 files changed, 37 insertions, 38 deletions
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index e21857c755c0..7be5ca8130c2 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -40,6 +40,7 @@
#include <IMark.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <istyleaccess.hxx>
#include <ndtxt.hxx>
#include <ndnotxt.hxx>
@@ -66,9 +67,7 @@
#include <fmtfld.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <poolfmt.hxx>
#include <edimp.hxx>
#include <fchrfmt.hxx>
@@ -226,10 +225,10 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
SwAsciiOptions aOpt = xWrt->GetAsciiOptions();
aOpt.SetCharSet( RTL_TEXTENCODING_UNICODE );
xWrt->SetAsciiOptions( aOpt );
- xWrt->bUCS2_WithStartChar = FALSE;
+ xWrt->bUCS2_WithStartChar = sal_False;
// --> FME #i68522#
- const BOOL bOldShowProgress = xWrt->bShowProgress;
- xWrt->bShowProgress = FALSE;
+ const sal_Bool bOldShowProgress = xWrt->bShowProgress;
+ xWrt->bShowProgress = sal_False;
// <--
long lLen;
@@ -315,8 +314,8 @@ throw (lang::IllegalArgumentException)
if(pStyle.get())
{
SwFmtAutoFmt aFmt( (bPara)
- ? sal::static_int_cast< USHORT >(RES_AUTO_STYLE)
- : sal::static_int_cast< USHORT >(RES_TXTATR_AUTOFMT) );
+ ? sal::static_int_cast< sal_uInt16 >(RES_AUTO_STYLE)
+ : sal::static_int_cast< sal_uInt16 >(RES_TXTATR_AUTOFMT) );
aFmt.SetStyleHandle( pStyle );
rSet.Put(aFmt);
}
@@ -350,13 +349,13 @@ throw (lang::IllegalArgumentException)
SwTxtFmtColl *const pLocal = pStyle->GetCollection();
UnoActionContext aAction(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPaM *pTmpCrsr = &rPaM;
do {
pDoc->SetTxtFmtColl(*pTmpCrsr, pLocal);
pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext());
} while ( pTmpCrsr != &rPaM );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
/* -----------------06.07.98 07:38-------------------
@@ -427,7 +426,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
if( rCrsr.GetNext() != &rCrsr ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rCrsr );
SwPaM aPam( *rCrsr.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
@@ -436,7 +435,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
pDoc->SetNodeNumStart(*aRangeArr.SetPam( n, aPam ).GetPoint(),
nStt );
}
- pDoc->EndUndo( UNDO_END, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
@@ -457,7 +456,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
for (sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++)
{
uno::Any aStyle;
- rPam.GetDoc()->StartUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
aStyle <<= aCharStyles.getConstArray()[nStyle];
// create a local set and apply each format directly
SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(),
@@ -468,7 +467,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
SwUnoCursorHelper::SetCrsrAttr(rPam, aSet, (nStyle)
? nsSetAttrMode::SETATTR_DONTREPLACE
: nsSetAttrMode::SETATTR_DEFAULT);
- rPam.GetDoc()->EndUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_START, NULL);
}
return true;
}
@@ -701,8 +700,8 @@ SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
SwPaM *pTmpCrsr = &rPaM;
do
{
- const ULONG nSttNd = pTmpCrsr->Start()->nNode.GetIndex();
- const ULONG nEndNd = pTmpCrsr->End()->nNode.GetIndex();
+ const sal_uLong nSttNd = pTmpCrsr->Start()->nNode.GetIndex();
+ const sal_uLong nEndNd = pTmpCrsr->End()->nNode.GetIndex();
if( nEndNd - nSttNd >= nMaxLookup )
{
@@ -711,7 +710,7 @@ SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
}
const SwNodes& rNds = rPaM.GetDoc()->GetNodes();
- for( ULONG n = nSttNd; n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
{
SwTxtNode const*const pNd = rNds[ n ]->GetTxtNode();
if( pNd )
@@ -931,7 +930,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
SwDoc* pDoc = pUnoCrsr->GetDoc();
UnoActionContext aAction(pDoc);
const xub_StrLen nTxtLen = rText.getLength();
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
SwCursor * pCurrent = pUnoCrsr;
do
{
@@ -949,11 +948,11 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
SwUnoCursorHelper::SelectPam(*pUnoCrsr, true);
pCurrent->Left(rText.getLength(),
- CRSR_SKIP_CHARS, FALSE, FALSE);
+ CRSR_SKIP_CHARS, sal_False, sal_False);
}
pCurrent = static_cast<SwCursor *>(pCurrent->GetNext());
} while (pCurrent != pUnoCrsr);
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
}
@@ -1156,7 +1155,7 @@ throw (uno::RuntimeException)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- sal_Bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, FALSE, FALSE);
+ sal_Bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, sal_False, sal_False);
if (CURSOR_META == m_pImpl->m_eType)
{
bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText,
@@ -1177,7 +1176,7 @@ throw (uno::RuntimeException)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- sal_Bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, FALSE, FALSE);
+ sal_Bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, sal_False, sal_False);
if (CURSOR_META == m_pImpl->m_eType)
{
bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText,
@@ -1453,7 +1452,7 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException)
if (rUnoCursor.GetCntntNode() &&
(pPoint->nContent == rUnoCursor.GetCntntNode()->Len()))
{
- rUnoCursor.Right(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Right(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
else
{
@@ -1499,14 +1498,14 @@ SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException)
// start of paragraph?
if (pPoint->nContent == 0)
{
- rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Left(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
else
{
rUnoCursor.GoPrevWordWT( i18n::WordType::DICTIONARY_WORD );
if (pPoint->nContent == 0)
{
- rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Left(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
}
@@ -2175,10 +2174,10 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
{
if (!pSetParent.get())
{
- pSetParent.reset( pSet->Clone( FALSE ) );
+ pSetParent.reset( pSet->Clone( sal_False ) );
// --> OD 2006-07-12 #i63870#
SwUnoCursorHelper::GetCrsrAttr(
- rPaM, *pSetParent, TRUE, FALSE );
+ rPaM, *pSetParent, sal_True, sal_False );
// <--
}
@@ -2216,7 +2215,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
// if we are reseting paragraph attributes, we need to select the full paragraph first
SwPosition aStart = *rPaM.Start();
SwPosition aEnd = *rPaM.End();
- ::std::auto_ptr< SwUnoCrsr > pTemp ( rDoc.CreateUnoCrsr(aStart, FALSE) );
+ ::std::auto_ptr< SwUnoCrsr > pTemp ( rDoc.CreateUnoCrsr(aStart, sal_False) );
if(!SwUnoCursorHelper::IsStartOfPara(*pTemp))
{
pTemp->MovePara(fnParaCurr, fnParaStart);
@@ -2514,7 +2513,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
// para specific attribut ranges
-static USHORT g_ParaResetableSetRange[] = {
+static sal_uInt16 g_ParaResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
// --> OD 2008-02-25 #refactorlists#
@@ -2525,7 +2524,7 @@ static USHORT g_ParaResetableSetRange[] = {
};
// selection specific attribut ranges
-static USHORT g_ResetableSetRange[] = {
+static sal_uInt16 g_ResetableSetRange[] = {
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
@@ -2535,13 +2534,13 @@ static USHORT g_ResetableSetRange[] = {
};
static void
-lcl_EnumerateIds(USHORT const* pIdRange, SvUShortsSort & rWhichIds)
+lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds)
{
while (*pIdRange)
{
- const USHORT nStart = sal::static_int_cast<USHORT>(*pIdRange++);
- const USHORT nEnd = sal::static_int_cast<USHORT>(*pIdRange++);
- for (USHORT nId = nStart + 1; nId <= nEnd; ++nId)
+ const sal_uInt16 nStart = sal::static_int_cast<sal_uInt16>(*pIdRange++);
+ const sal_uInt16 nEnd = sal::static_int_cast<sal_uInt16>(*pIdRange++);
+ for (sal_uInt16 nId = nStart + 1; nId <= nEnd; ++nId)
{
rWhichIds.Insert( nId );
}
@@ -2820,17 +2819,17 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
SwSortKey* pKey1 = new SwSortKey;
pKey1->nColumnId = USHRT_MAX;
- pKey1->bIsNumeric = TRUE;
+ pKey1->bIsNumeric = sal_True;
pKey1->eSortOrder = SRT_ASCENDING;
SwSortKey* pKey2 = new SwSortKey;
pKey2->nColumnId = USHRT_MAX;
- pKey2->bIsNumeric = TRUE;
+ pKey2->bIsNumeric = sal_True;
pKey2->eSortOrder = SRT_ASCENDING;
SwSortKey* pKey3 = new SwSortKey;
pKey3->nColumnId = USHRT_MAX;
- pKey3->bIsNumeric = TRUE;
+ pKey3->bIsNumeric = sal_True;
pKey3->eSortOrder = SRT_ASCENDING;
SwSortKey* aKeys[3] = {pKey1, pKey2, pKey3};
@@ -3012,7 +3011,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
SvxLocaleToLanguage( pFields[i].CollatorLocale );
aKeys[i]->sSortType = pFields[i].CollatorAlgorithm;
aKeys[i]->nColumnId =
- static_cast<USHORT>(pFields[i].Field);
+ static_cast<sal_uInt16>(pFields[i].Field);
aKeys[i]->bIsNumeric = (pFields[i].FieldType ==
table::TableSortFieldType_NUMERIC);
aKeys[i]->eSortOrder = (pFields[i].IsAscending)
@@ -3078,7 +3077,7 @@ throw (uno::RuntimeException)
SwPosition & rEnd = *rUnoCursor.End();
SwNodeIndex aPrevIdx( rStart.nNode, -1 );
- const ULONG nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex();
+ const sal_uLong nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex();
const xub_StrLen nCntStt = rStart.nContent.GetIndex();
rUnoCursor.GetDoc()->SortText(rUnoCursor, aSortOpt);