summaryrefslogtreecommitdiff
path: root/sw/source/core/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx30
-rw-r--r--sw/source/core/doc/acmplwrd.cxx77
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx12
-rw-r--r--sw/source/core/doc/doc.cxx199
-rw-r--r--sw/source/core/doc/docbasic.cxx18
-rw-r--r--sw/source/core/doc/docbm.cxx48
-rw-r--r--sw/source/core/doc/docchart.cxx9
-rw-r--r--sw/source/core/doc/doccomp.cxx103
-rw-r--r--sw/source/core/doc/doccorr.cxx2
-rw-r--r--sw/source/core/doc/docdde.cxx4
-rw-r--r--sw/source/core/doc/docdesc.cxx65
-rw-r--r--sw/source/core/doc/docdraw.cxx168
-rw-r--r--sw/source/core/doc/docedt.cxx98
-rw-r--r--sw/source/core/doc/docfld.cxx187
-rw-r--r--sw/source/core/doc/docfly.cxx76
-rw-r--r--sw/source/core/doc/docfmt.cxx150
-rw-r--r--sw/source/core/doc/docftn.cxx14
-rw-r--r--sw/source/core/doc/docglbl.cxx36
-rw-r--r--sw/source/core/doc/docglos.cxx6
-rw-r--r--sw/source/core/doc/doclay.cxx190
-rw-r--r--sw/source/core/doc/docnew.cxx157
-rw-r--r--sw/source/core/doc/docnum.cxx451
-rw-r--r--sw/source/core/doc/docredln.cxx151
-rw-r--r--sw/source/core/doc/docruby.cxx26
-rw-r--r--sw/source/core/doc/docsort.cxx68
-rw-r--r--sw/source/core/doc/docstat.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx141
-rw-r--r--sw/source/core/doc/docxforms.cxx3
-rw-r--r--sw/source/core/doc/extinput.cxx4
-rw-r--r--sw/source/core/doc/fmtcol.cxx51
-rw-r--r--sw/source/core/doc/ftnidx.cxx2
-rw-r--r--sw/source/core/doc/gctable.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx137
-rw-r--r--sw/source/core/doc/lineinfo.cxx6
-rw-r--r--sw/source/core/doc/list.cxx14
-rw-r--r--sw/source/core/doc/notxtfrm.cxx98
-rw-r--r--sw/source/core/doc/number.cxx377
-rw-r--r--sw/source/core/doc/poolfmt.cxx233
-rw-r--r--sw/source/core/doc/sortopt.cxx11
-rw-r--r--sw/source/core/doc/swserv.cxx20
-rw-r--r--sw/source/core/doc/swstylemanager.cxx13
-rw-r--r--sw/source/core/doc/swstylemanager.hxx7
-rwxr-xr-xsw/source/core/doc/tblafmt.cxx32
-rw-r--r--sw/source/core/doc/tblcpy.cxx38
-rw-r--r--sw/source/core/doc/tblrwcl.cxx151
-rw-r--r--sw/source/core/doc/visiturl.cxx2
46 files changed, 1039 insertions, 2654 deletions
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index d25c7d8417cb..eb653789da52 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,12 @@
#include <svl/svstdarr.hxx>
#include <tools/resmgr.hxx>
#include <poolfmt.hxx>
-#ifndef _RDIC_HRC
#include <rcid.hrc>
-#endif
#include <tools/debug.hxx>
+#ifdef _NEED_TO_DEBUG_MAPPING
+#include <stdlib.h>
+#endif
+
extern ResMgr* pSwResMgr;
// Initialise UI names to 0
SvStringsDtor *SwStyleNameMapper::pTextUINameArray = 0,
@@ -485,7 +488,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_LISTS_BEGIN ; nId < RES_POOLCOLL_LISTS_END ; nId++,nIndex++ )
{
@@ -497,7 +500,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_EXTRA_BEGIN ; nId < RES_POOLCOLL_EXTRA_END ; nId++,nIndex++ )
{
@@ -509,7 +512,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_REGISTER_BEGIN ; nId < RES_POOLCOLL_REGISTER_END ; nId++,nIndex++ )
{
@@ -521,7 +524,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_DOC_BEGIN ; nId < RES_POOLCOLL_DOC_END ; nId++,nIndex++ )
{
@@ -533,7 +536,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_HTML_BEGIN ; nId < RES_POOLCOLL_HTML_END ; nId++,nIndex++ )
{
@@ -545,7 +548,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -559,7 +562,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCHR_HTML_BEGIN ; nId < RES_POOLCHR_HTML_END ; nId++,nIndex++ )
{
@@ -571,7 +574,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -585,7 +588,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -599,7 +602,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -613,7 +616,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
}
@@ -1140,3 +1143,4 @@ const String SwStyleNameMapper::GetSpecialExtraUIName( const String& rExtraProgN
return aRes;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index f1285cd48ba1..ec5c65332b1c 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,14 +50,12 @@
#include <docsh.hxx>
#include <vector>
-/* -----------------------------05.08.2002 12:43------------------------------
- ---------------------------------------------------------------------------*/
class SwAutoCompleteClient : public SwClient
{
SwAutoCompleteWord* pAutoCompleteWord;
SwDoc* pDoc;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong nSwAutoCompleteClientCount;
#endif
public:
@@ -67,15 +66,13 @@ public:
SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient);
const SwDoc& GetDoc(){return *pDoc;}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
-/* -----------------------------05.08.2002 12:48------------------------------
- ---------------------------------------------------------------------------*/
typedef std::vector<SwAutoCompleteClient> SwAutoCompleteClientVector;
class SwAutoCompleteWord_Impl
@@ -89,14 +86,11 @@ public:
void RemoveDocument(const SwDoc& rDoc);
};
-/* -----------------------------05.08.2002 14:11------------------------------
-
- ---------------------------------------------------------------------------*/
typedef const SwDoc* SwDocPtr;
typedef std::vector<SwDocPtr> SwDocPtrVector;
class SwAutoCompleteString : public String
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong nSwAutoCompleteStringCount;
#endif
SwDocPtrVector aSourceDocs;
@@ -107,51 +101,43 @@ class SwAutoCompleteString : public String
void AddDocument(const SwDoc& rDoc);
//returns true if last document reference has been removed
sal_Bool RemoveDocument(const SwDoc& rDoc);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong GetElementCount() {return nSwAutoCompleteStringCount;}
#endif
};
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uLong SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
sal_uLong SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
#endif
-/* -----------------------------06.08.2002 08:57------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::SwAutoCompleteClient(SwAutoCompleteWord& rToTell, SwDoc& rSwDoc) :
pAutoCompleteWord(&rToTell),
pDoc(&rSwDoc)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteClientCount;
#endif
}
-/* -----------------------------05.08.2002 14:07------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::SwAutoCompleteClient(const SwAutoCompleteClient& rClient) :
SwClient(),
pAutoCompleteWord(rClient.pAutoCompleteWord),
pDoc(rClient.pDoc)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteClientCount;
#endif
}
-/* -----------------------------05.08.2002 14:10------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::~SwAutoCompleteClient()
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
--nSwAutoCompleteClientCount;
#endif
}
-/* -----------------06.03.2003 15:30-----------------
- --------------------------------------------------*/
SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient& rClient)
{
pAutoCompleteWord = rClient.pAutoCompleteWord;
@@ -162,9 +148,7 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient
GetRegisteredInNonConst()->Remove(this);
return *this;
}
-/* -----------------------------05.08.2002 12:49------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *)
{
switch( pOld ? pOld->Which() : 0 )
@@ -178,26 +162,22 @@ void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *)
}
}
-/* -----------------------------05.08.2002 13:03------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord_Impl::AddDocument(SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
return;
}
aClientVector.push_back(SwAutoCompleteClient(rAutoCompleteWord, rDoc));
}
-/* -----------------------------05.08.2002 14:33------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
{
@@ -206,32 +186,26 @@ void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc)
}
}
}
-/* -----------------------------06.08.2002 08:54------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteString::SwAutoCompleteString(const String& rStr, xub_StrLen nPos, xub_StrLen nLen) :
String( rStr, nPos, nLen )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteStringCount;
#endif
}
-/* -----------------------------05.08.2002 14:22------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteString::~SwAutoCompleteString()
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
--nSwAutoCompleteStringCount;
#endif
}
-/* -----------------------------05.08.2002 14:17------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
return;
@@ -239,13 +213,11 @@ void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
SwDocPtr pNew = &rDoc;
aSourceDocs.push_back(pNew);
}
-/* -----------------------------05.08.2002 14:36------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
{
@@ -255,9 +227,7 @@ sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
}
return sal_False;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteWord::SwAutoCompleteWord( sal_uInt16 nWords, sal_uInt16 nMWrdLen )
: aWordLst( 0, 255 ), aLRULst( 0, 255 ),
pImpl(new SwAutoCompleteWord_Impl(*this)),
@@ -276,10 +246,10 @@ SwAutoCompleteWord::~SwAutoCompleteWord()
delete pCurrent;
}
delete pImpl;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uLong nStrings = SwAutoCompleteString::GetElementCount();
sal_uLong nClients = SwAutoCompleteClient::GetElementCount();
- DBG_ASSERT(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
+ OSL_ENSURE(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
#endif
}
@@ -341,7 +311,7 @@ sal_Bool SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
pCurrent->AddDocument(rDoc);
nInsPos = aLRULst.GetPos( (void*)pNew );
- ASSERT( USHRT_MAX != nInsPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nInsPos, "String nicht gefunden" );
if( nInsPos )
{
void** ppData = (void**)aLRULst.GetData();
@@ -362,7 +332,7 @@ void SwAutoCompleteWord::SetMaxCount( sal_uInt16 nNewMax )
while( nNewMax < aWordLst.Count() && nLRUIndex < aLRULst.Count())
{
sal_uInt16 nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
void * pDel = aWordLst[nPos];
aWordLst.Remove(nPos);
delete (SwAutoCompleteString*)pDel;
@@ -388,7 +358,7 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
aWordLst.Remove(nPos);
sal_uInt16 nDelPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nDelPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nDelPos, "String nicht gefunden" );
aLRULst.Remove( nDelPos );
--nPos;
delete (SwAutoCompleteString*)pDel;
@@ -426,7 +396,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
aWordLst.Remove(nMyPos);
sal_uInt16 nPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
if( nMyPos >= --nMyLen )
@@ -441,7 +411,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
{
void* pDel = aWordLst[ nNewPos ];
sal_uInt16 nPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
}
@@ -449,9 +419,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
aWordLst.Remove( nMyPos, nMyLen - nMyPos );
}
}
-/* -----------------------------05.08.2002 12:54------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
{
pImpl->RemoveDocument(rDoc);
@@ -472,3 +440,4 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 08dab4aff359..4444a713ea78 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,7 +113,8 @@ SW_DLLPUBLIC const char * dbg_out(const String & aStr)
SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
{
- return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr();
+ aDbgOutResult = ByteString( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_ASCII_US ) );
+ return aDbgOutResult.GetBuffer();
}
@@ -550,7 +552,7 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String::CreateFromInt32(rNode.GetIndex());
aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aTmpStr += String(" serial=\"", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String::CreateFromInt32(rNode.GetSerial());
aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
@@ -638,7 +640,6 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String::CreateFromInt32
- //(static_cast<SwTxtFmtColl *>(pColl)->GetOutlineLevel());//#outline level,zhaojianwei
(static_cast<SwTxtFmtColl *>(pColl)->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
const SwNumRuleItem & rItem =
@@ -977,7 +978,7 @@ String lcl_TokenType2Str(FormTokenType nType)
return String("??", RTL_TEXTENCODING_ASCII_US);
}
- ASSERT(false, "should not be reached");
+ OSL_FAIL("should not be reached");
return String("??", RTL_TEXTENCODING_ASCII_US);
}
@@ -998,7 +999,7 @@ String lcl_dbg_out(const SwFormTokens & rTokens)
SwFormTokens::const_iterator aIt;
- for (aIt = rTokens.begin(); aIt != rTokens.end(); aIt++)
+ for (aIt = rTokens.begin(); aIt != rTokens.end(); ++aIt)
{
if (aIt != rTokens.begin())
aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
@@ -1038,3 +1039,4 @@ SW_DLLPUBLIC const char * dbg_out(const SwNodeRange & rRange)
#endif // DEBUG
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index c454da191cf7..a031aa86098f 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,7 +76,6 @@
#include <txtrfmrk.hxx>
#include <frmatr.hxx>
#include <linkenum.hxx>
-#include <errhdl.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <swtable.hxx>
@@ -86,7 +86,7 @@
#include <UndoInsert.hxx>
#include <UndoSplitMove.hxx>
#include <UndoTable.hxx>
-#include <pagedesc.hxx> //DTor
+#include <pagedesc.hxx> //DTor
#include <breakit.hxx>
#include <ndole.hxx>
#include <ndgrf.hxx>
@@ -135,14 +135,11 @@
/* @@@MAINTAINABILITY-HORROR@@@
Probably unwanted dependency on SwDocShell
*/
-// --> OD 2005-08-29 #125370#
#include <layouter.hxx>
-// <--
using namespace ::com::sun::star;
using ::rtl::OUString;
-
// Seiten-Deskriptoren
SV_IMPL_PTRARR(SwPageDescs,SwPageDescPtr);
// Verzeichnisse
@@ -150,11 +147,10 @@ SV_IMPL_PTRARR( SwTOXTypes, SwTOXTypePtr )
// FeldTypen
SV_IMPL_PTRARR( SwFldTypes, SwFldTypePtr)
-/** IInterface
-*/
+/* IInterface */
sal_Int32 SwDoc::acquire()
{
- OSL_ASSERT(mReferenceCount >= 0 && "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
+ OSL_ENSURE(mReferenceCount >= 0, "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
return osl_incrementInterlockedCount(&mReferenceCount);
}
@@ -166,12 +162,11 @@ sal_Int32 SwDoc::release()
sal_Int32 SwDoc::getReferenceCount() const
{
- OSL_ASSERT(mReferenceCount >= 0 && "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
+ OSL_ENSURE(mReferenceCount >= 0, "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
return mReferenceCount;
}
-/** IDocumentSettingAccess
-*/
+/* IDocumentSettingAccess */
bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
{
switch (id)
@@ -196,17 +191,16 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case TABLE_ROW_KEEP: return mbTableRowKeep;
case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
- // --> OD 2006-08-25 #i68949#
+ // #i68949#
case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
- // <--
case UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
case USE_OLD_PRINTER_METRICS: return mbOldPrinterMetrics;
case TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
case PROTECT_FORM: return mbProtectForm;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
- // <--
- // COMPATIBILITY FLAGS END
+ case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
+ case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
case HTML_MODE: return mbHTMLMode;
@@ -218,7 +212,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
default:
- ASSERT(false, "Invalid setting id");
+ OSL_FAIL("Invalid setting id");
}
return false;
}
@@ -263,9 +257,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
if (pOutlineRule)
{
pOutlineRule->Validate();
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !mbOldNumbering );
- // <--
}
}
break;
@@ -307,52 +300,67 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbDoNotCaptureDrawObjsOnPage = value;
break;
- // --> OD 2006-08-25 #i68949#
+ // #i68949#
case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
mbClipAsCharacterAnchoredWriterFlyFrames = value;
break;
- // <--
+
case UNIX_FORCE_ZERO_EXT_LEADING:
mbUnixForceZeroExtLeading = value;
break;
+
case PROTECT_FORM:
- mbProtectForm = value;
- break;
+ mbProtectForm = value;
+ break;
case USE_OLD_PRINTER_METRICS:
mbOldPrinterMetrics = value;
break;
case TABS_RELATIVE_TO_INDENT:
mbTabRelativeToIndent = value;
- break;
- // --> OD 2008-06-05 #i89181#
+ break;
+ // #i89181#
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
mbTabAtLeftIndentForParagraphsInList = value;
- break;
- // <--
+ break;
+
+ case INVERT_BORDER_SPACING:
+ mbInvertBorderSpacing = value;
+ break;
+
+ case COLLAPSE_EMPTY_CELL_PARA:
+ mbCollapseEmptyCellPara = value;
+ break;
// COMPATIBILITY FLAGS END
case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
mbLastBrowseMode = value;
break;
+
case HTML_MODE:
mbHTMLMode = value;
break;
+
case GLOBAL_DOCUMENT:
mbIsGlobalDoc = value;
break;
+
case GLOBAL_DOCUMENT_SAVE_LINKS:
mbGlblDocSaveLinks = value;
break;
+
case LABEL_DOCUMENT:
mbIsLabelDoc = value;
break;
+
case PURGE_OLE:
mbPurgeOLE = value;
break;
+
case KERN_ASIAN_PUNCTUATION:
mbKernAsianPunctuation = value;
break;
+
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
mbDoNotResetParaAttrsForNumFont = value;
break;
@@ -360,7 +368,7 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbMathBaselineAlignment = value;
break;
default:
- ASSERT(false, "Invalid setting id");
+ OSL_FAIL("Invalid setting id");
}
}
@@ -368,7 +376,7 @@ const i18n::ForbiddenCharacters*
SwDoc::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
{
const i18n::ForbiddenCharacters* pRet = 0;
- if( xForbiddenCharsTable.isValid() )
+ if( xForbiddenCharsTable.is() )
pRet = xForbiddenCharsTable->GetForbiddenCharacters( nLang, sal_False );
if( bLocaleData && !pRet && pBreakIt )
pRet = &pBreakIt->GetForbidden( (LanguageType)nLang );
@@ -378,7 +386,7 @@ const i18n::ForbiddenCharacters*
void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
/*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
{
- if( !xForbiddenCharsTable.isValid() )
+ if( !xForbiddenCharsTable.is() )
{
uno::Reference<
lang::XMultiServiceFactory > xMSF =
@@ -404,9 +412,9 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
SetModified();
}
-vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
+rtl::Reference<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
{
- if( !xForbiddenCharsTable.isValid() )
+ if( !xForbiddenCharsTable.is() )
{
uno::Reference<
lang::XMultiServiceFactory > xMSF =
@@ -416,7 +424,7 @@ vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
return xForbiddenCharsTable;
}
-const vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable() const
+const rtl::Reference<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable() const
{
return xForbiddenCharsTable;
}
@@ -476,8 +484,7 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
}
}
-/** IDocumentDeviceAccess
-*/
+/* IDocumentDeviceAccess */
SfxPrinter* SwDoc::getPrinter(/*[in]*/ bool bCreate ) const
{
SfxPrinter* pRet = 0;
@@ -512,10 +519,9 @@ void SwDoc::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/
}
if ( bCallPrtDataChanged &&
- // --> FME 2005-01-21 #i41075# Do not call PrtDataChanged() if we do not
+ // #i41075# Do not call PrtDataChanged() if we do not
// use the printer for formatting:
!get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) )
- // <--
PrtDataChanged();
}
@@ -581,14 +587,13 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
}
else
{
- // --> FME 2005-01-21 #i41075#
+ // #i41075#
// We have to take care that a printer exists before calling
// PrtDataChanged() in order to prevent that PrtDataChanged()
// triggers this funny situation:
// getReferenceDevice()->getPrinter()->CreatePrinter_()
// ->setPrinter()-> PrtDataChanged()
SfxPrinter* pPrinter = getPrinter( true );
- // <--
if( pDrawModel )
pDrawModel->SetRefDevice( pPrinter );
}
@@ -672,8 +677,7 @@ void SwDoc::setPrintData(/*[in]*/ const SwPrintData& rPrtData )
*pPrtData = rPrtData;
}
-/** Implementations the next Interface here
-*/
+/* Implementations the next Interface here */
/*
* Dokumenteditieren (Doc-SS) zum Fuellen des Dokuments
@@ -696,7 +700,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
return false;
{
- // Bug 26675: DataChanged vorm loeschen verschicken, dann bekommt
+ // BUG 26675: DataChanged vorm loeschen verschicken, dann bekommt
// man noch mit, welche Objecte sich im Bereich befinden.
// Danach koennen sie vor/hinter der Position befinden.
SwDataChanged aTmp( this, rPos, 0 );
@@ -791,7 +795,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
_SaveCntntIdx( this, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(),
aBkmkArr, SAVEFLY_SPLIT );
// FIXME: only SwTxtNode has a valid implementation of SplitCntntNode!
- ASSERT(pNode->IsTxtNode(), "splitting non-text node?");
+ OSL_ENSURE(pNode->IsTxtNode(), "splitting non-text node?");
pNode = pNode->SplitCntntNode( rPos );
if (pNode)
{
@@ -893,11 +897,10 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
}
else
{ // ist Undo und Gruppierung eingeschaltet, ist alles anders !
- SwUndoInsert * pUndo = NULL; // #111827#
+ SwUndoInsert * pUndo = NULL;
// don't group the start if hints at the start should be expanded
if (!(nInsertMode & IDocumentContentOperations::INS_FORCEHINTEXPAND))
- // -> #111827#
{
SwUndo *const pLastUndo = GetUndoManager().GetLastUndo();
SwUndoInsert *const pUndoInsert(
@@ -907,7 +910,6 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
pUndo = pUndoInsert;
}
}
- // <- #111827#
CharClass const& rCC = GetAppCharClass();
xub_StrLen nInsPos = rPos.nContent.GetIndex();
@@ -985,6 +987,7 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg,
pDfltGrfFmtColl ),
pFlyAttrSet, pGrfAttrSet, pFrmFmt );
}
+
SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj,
const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet,
@@ -1044,7 +1047,6 @@ SwFlyFrmFmt* SwDoc::InsertOLE(const SwPaM &rRg, const String& rObjName,
|* SwDoc::GetFldType()
|* Beschreibung: liefert den am Doc eingerichteten Feldtypen zurueck
*************************************************************************/
-
SwFieldType *SwDoc::GetSysFldType( const sal_uInt16 eWhich ) const
{
for( sal_uInt16 i = 0; i < INIT_FLDTYPES; ++i )
@@ -1052,10 +1054,10 @@ SwFieldType *SwDoc::GetSysFldType( const sal_uInt16 eWhich ) const
return (*pFldTypes)[i];
return 0;
}
+
/*************************************************************************
* void SetDocStat( const SwDocStat& rStat );
*************************************************************************/
-
void SwDoc::SetDocStat( const SwDocStat& rStat )
{
*pDocStat = rStat;
@@ -1066,9 +1068,6 @@ const SwDocStat& SwDoc::GetDocStat() const
return *pDocStat;
}
-/*************************************************************************/
-
-
struct _PostItFld : public _SetGetExpFld
{
_PostItFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, const SwIndex* pIdx = 0 )
@@ -1084,7 +1083,6 @@ struct _PostItFld : public _SetGetExpFld
}
};
-
sal_uInt16 _PostItFld::GetPageNo(
const StringRangeEnumerator &rRangeEnum,
const std::set< sal_Int32 > &rPossiblePages,
@@ -1116,7 +1114,6 @@ sal_uInt16 _PostItFld::GetPageNo(
return 0;
}
-
bool lcl_GetPostIts(
IDocumentFieldsAccess* pIDFA,
_SetGetExpFlds * pSrtLst )
@@ -1152,7 +1149,6 @@ bool lcl_GetPostIts(
return bHasPostIts;
}
-
static void lcl_FormatPostIt(
IDocumentContentOperations* pIDCO,
SwPaM& aPam,
@@ -1160,7 +1156,7 @@ static void lcl_FormatPostIt(
bool bNewPage, bool bIsFirstPostIt,
sal_uInt16 nPageNo, sal_uInt16 nLineNo )
{
- static char __READONLY_DATA sTmp[] = " : ";
+ static char const sTmp[] = " : ";
DBG_ASSERT( ViewShell::GetShellRes(), "missing ShellRes" );
@@ -1205,7 +1201,6 @@ static void lcl_FormatPostIt(
pIDCO->InsertString( aPam, aStr );
}
-
// provide the paper tray to use according to the page style in use,
// but do that only if the respective item is NOT just the default item
static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
@@ -1222,7 +1217,6 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
return nRes;
}
-
void SwDoc::CalculatePagesForPrinting(
const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
@@ -1251,7 +1245,6 @@ void SwDoc::CalculatePagesForPrinting(
sal_uInt16 nFirstPageNo = 0;
sal_uInt16 nLastPageNo = 0;
- sal_uInt16 nPageNo = 1;
for( sal_uInt16 i = 1; i <= (sal_uInt16)aPages.Max(); ++i )
{
@@ -1298,7 +1291,7 @@ void SwDoc::CalculatePagesForPrinting(
aMulti = aTmpMulti;
// Ende des HACKs
- nPageNo = nFirstPageNo;
+ sal_uInt16 nPageNo = nFirstPageNo;
std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays();
std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet();
@@ -1312,9 +1305,8 @@ void SwDoc::CalculatePagesForPrinting(
( (bRightPg && bPrintRightPages) ||
(!bRightPg && bPrintLeftPages) ) )
{
- // --> FME 2005-12-12 #b6354161# Feature - Print empty pages
+ // Feature - Print empty pages
if ( bPrintEmptyPages || pStPage->Frm().Height() )
- // <--
{
rValidPages.insert( nPageNo );
rValidStartFrms[ nPageNo ] = pStPage;
@@ -1344,14 +1336,8 @@ void SwDoc::CalculatePagesForPrinting(
// get PageRange value to use
OUString aPageRange;
- // --> PL, OD #i116085# - adjusting fix for i113919
-// if (bIsPDFExport)
-// {
-// aPageRange = rOptions.getStringValue( "PageRange", OUString() );
-// }
-// else
+ // #i116085# - adjusting fix for i113919
if ( !bIsPDFExport )
- // <--
{
// PageContent :
// 0 -> print all pages (default if aPageRange is empty)
@@ -1386,7 +1372,6 @@ void SwDoc::CalculatePagesForPrinting(
1, nDocPageCount, 0, &rData.GetValidPagesSet() );
}
-
void SwDoc::UpdatePagesForPrintingWithPostItData(
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
@@ -1570,7 +1555,6 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
}
}
-
void SwDoc::CalculatePagePairsForProspectPrinting(
const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
@@ -1720,7 +1704,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
/*************************************************************************
* void UpdateDocStat( const SwDocStat& rStat );
*************************************************************************/
-
void SwDoc::UpdateDocStat( SwDocStat& rStat )
{
if( rStat.bModified )
@@ -1762,25 +1745,27 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
rStat.bModified = sal_False;
SetDocStat( rStat );
- com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aStat( rStat.nPage ? 7 : 6);
+ com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aStat( rStat.nPage ? 8 : 7);
sal_Int32 n=0;
- aStat[n].Name = ::rtl::OUString::createFromAscii("TableCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nTbl;
- aStat[n].Name = ::rtl::OUString::createFromAscii("ImageCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nGrf;
- aStat[n].Name = ::rtl::OUString::createFromAscii("ObjectCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nOLE;
if ( rStat.nPage )
{
- aStat[n].Name = ::rtl::OUString::createFromAscii("PageCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nPage;
}
- aStat[n].Name = ::rtl::OUString::createFromAscii("ParagraphCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParagraphCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nPara;
- aStat[n].Name = ::rtl::OUString::createFromAscii("WordCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nWord;
- aStat[n].Name = ::rtl::OUString::createFromAscii("CharacterCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharacterCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nChar;
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NonWhitespaceCharacterCount"));
+ aStat[n++].Value <<= (sal_Int32)rStat.nCharExcludingSpaces;
// For e.g. autotext documents there is no pSwgInfo (#i79945)
SfxObjectShell * const pObjShell( GetDocShell() );
@@ -1806,9 +1791,7 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
-
// Dokument - Info
-
void SwDoc::DocInfoChgd( )
{
GetSysFldType( RES_DOCINFOFLD )->UpdateFlds();
@@ -1816,7 +1799,7 @@ void SwDoc::DocInfoChgd( )
SetModified();
}
- // returne zum Namen die im Doc gesetzte Referenz
+// returne zum Namen die im Doc gesetzte Referenz
const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const
{
const SfxPoolItem* pItem;
@@ -1835,7 +1818,7 @@ const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const
return 0;
}
- // returne die RefMark per Index - fuer Uno
+// returne die RefMark per Index - fuer Uno
const SwFmtRefMark* SwDoc::GetRefMark( sal_uInt16 nIndex ) const
{
const SfxPoolItem* pItem;
@@ -1859,10 +1842,10 @@ const SwFmtRefMark* SwDoc::GetRefMark( sal_uInt16 nIndex ) const
return pRet;
}
- // returne die Namen aller im Doc gesetzten Referenzen
- //JP 24.06.96: Ist der ArrayPointer 0 dann returne nur, ob im Doc. eine
- // RefMark gesetzt ist
- // OS 25.06.96: ab jetzt wird immer die Anzahl der Referenzen returnt
+// returne die Namen aller im Doc gesetzten Referenzen
+//JP 24.06.96: Ist der ArrayPointer 0 dann returne nur, ob im Doc. eine
+// RefMark gesetzt ist
+// OS 25.06.96: ab jetzt wird immer die Anzahl der Referenzen returnt
sal_uInt16 SwDoc::GetRefMarks( SvStringsDtor* pNames ) const
{
const SfxPoolItem* pItem;
@@ -1933,14 +1916,11 @@ bool SwDoc::IsModified() const
void SwDoc::SetModified()
{
- // --> OD 2005-08-29 #125370#
SwLayouter::ClearMovedFwdFrms( *this );
SwLayouter::ClearObjsTmpConsiderWrapInfluence( *this );
SwLayouter::ClearFrmsNotToWrap( *this );
- // <--
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
SwLayouter::ClearMoveBwdLayoutInfo( *this );
- // <--
// dem Link wird der Status returnt, wie die Flags waren und werden
// Bit 0: -> alter Zustand
// Bit 1: -> neuer Zustand
@@ -1978,7 +1958,6 @@ void SwDoc::ResetModified()
}
}
-
void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
const String& rFltName, const Graphic* pGraphic,
const GraphicObject* pGrafObj )
@@ -2050,7 +2029,6 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
return sal_True;
}
-
/*************************************************************************
* SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong )
*
@@ -2061,11 +2039,10 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
* Mit bOnlyWrong kann man dann steuern, ob nur die Bereiche mit falschen
* Woertern oder die kompletten Bereiche neu ueberprueft werden muessen.
************************************************************************/
-
void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags )
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307
- ASSERT( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
+ OSL_ENSURE( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
if( bInvalid )
{
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::AllInvalidateSmartTagsOrSpelling),bSmartTags));//swmod 080305
@@ -2127,8 +2104,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
{
::SetProgressState( i, GetDocShell() );
const sal_uLong nIndex = rOutNds[ i ]->GetIndex();
- //sal_uInt8 nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetTxtColl()//#outline level,zhaojianwei
- // ->GetOutlineLevel();
+
const int nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
if( nLvl > nLevel )
continue;
@@ -2167,7 +2143,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
if( bImpress )
{
SwTxtFmtColl* pMyColl = pNd->GetTxtColl();
- //sal_uInt16 nHeadLine = static_cast<sal_uInt16>(pMyColl->GetOutlineLevel()==NO_NUMBERING ?//#outlinelevel,zhaojianwei
+
const sal_uInt16 nHeadLine = static_cast<sal_uInt16>(
!pMyColl->IsAssignedToListLevelOfOutlineStyle() //<-end,zhaojianwei
? RES_POOLCOLL_HEADLINE2
@@ -2189,8 +2165,8 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
}
}
- // loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
- // versteckte Bereiche, versteckte Absaetze
+// loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
+// versteckte Bereiche, versteckte Absaetze
bool SwDoc::RemoveInvisibleContent()
{
sal_Bool bRet = sal_False;
@@ -2269,12 +2245,10 @@ bool SwDoc::RemoveInvisibleContent()
SwScriptInfo::DeleteHiddenRanges( *pTxtNd );
}
- // --> FME 2006-01-11 #120473#
// Footnotes/Frames may have been removed, therefore we have
// to reset n:
if ( bRemoved )
n = aPam.GetPoint()->nNode.GetIndex();
- // <--
}
}
@@ -2423,9 +2397,7 @@ bool SwDoc::RestoreInvisibleContent()
return bRet;
}
-/*-- 11.06.2004 08:34:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwDoc::ConvertFieldsToText()
{
sal_Bool bRet = sal_False;
@@ -2533,7 +2505,7 @@ bool SwDoc::LinksUpdated() const
return mbLinksUpdated;
}
- // embedded alle lokalen Links (Bereiche/Grafiken)
+// embedded alle lokalen Links (Bereiche/Grafiken)
::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr )
{
for( sal_uInt16 n = 0; n < rLinks.Count(); ++n )
@@ -2586,10 +2558,6 @@ bool SwDoc::EmbedAllLinks()
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsInsTblFormatNum() const
{
return SW_MOD()->IsInsTblFormatNum(get(IDocumentSettingAccess::HTML_MODE));
@@ -2600,16 +2568,12 @@ sal_Bool SwDoc::IsInsTblChangeNumFormat() const
return SW_MOD()->IsInsTblChangeNumFormat(get(IDocumentSettingAccess::HTML_MODE));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsInsTblAlignNum() const
{
return SW_MOD()->IsInsTblAlignNum(get(IDocumentSettingAccess::HTML_MODE));
}
- // setze das InsertDB als Tabelle Undo auf:
+// setze das InsertDB als Tabelle Undo auf:
void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable )
{
if( bIsTable )
@@ -2650,7 +2614,6 @@ void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
}
}
-// #111827#
String SwDoc::GetPaMDescr(const SwPaM & rPam) const
{
String aResult;
@@ -2689,7 +2652,6 @@ String SwDoc::GetPaMDescr(const SwPaM & rPam) const
return aResult;
}
-// -> #111840#
SwField * SwDoc::GetField(const SwPosition & rPos)
{
SwTxtFld * const pAttr = GetTxtFld(rPos);
@@ -2706,7 +2668,6 @@ SwTxtFld * SwDoc::GetTxtFld(const SwPosition & rPos)
rPos.nContent.GetIndex(), RES_TXTATR_FIELD) )
: 0;
}
-// <- #111840#
bool SwDoc::ContainsHiddenChars() const
{
@@ -2743,7 +2704,6 @@ void SwDoc::ChkCondColls()
}
}
-#ifdef FUTURE_VBA
uno::Reference< script::vba::XVBAEventProcessor >
SwDoc::GetVbaEventProcessor()
{
@@ -2762,7 +2722,6 @@ SwDoc::GetVbaEventProcessor()
}
return mxVbaEvents;
}
-#endif
void SwDoc::setExternalData(::sw::tExternalDataType eType,
::sw::tExternalDataPointer pPayload)
@@ -2774,3 +2733,5 @@ void SwDoc::setExternalData(::sw::tExternalDataType eType,
{
return m_externalData[eType];
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 77665e55fbce..00c6d40b5d91 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-#ifndef _RTL_USTRING_HXX //autogen
#include <rtl/ustring.hxx>
-#endif
#include <svtools/imap.hxx>
#include <svtools/imapobj.hxx>
#include <basic/sbx.hxx>
@@ -43,9 +42,7 @@
#include <frmatr.hxx>
#include <docary.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swevent.hxx>
using namespace ::com::sun::star::uno;
@@ -137,12 +134,6 @@ sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs
eErr = pDocShell->CallXScript(
rMacro.GetMacName(), *pUnoArgs, aRet, aOutArgsIndex, aOutArgs);
- //*pRet = pRetValue->GetString();
- // use the AnyConverter to return a String if appropriate?
-
- // need to call something like lcl_translateUno2Basic
- // pArgs = lcl_translateUno2Basic( pUnoArgs );
-
delete pUnoArgs;
break;
}
@@ -257,12 +248,6 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
nRet += 0 == pDocShell->CallXScript(
rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0;
- //*pRet = pRetValue->GetString();
- // use the AnyConverter to return a String if appropriate?
-
- // need to call something like lcl_translateUno2Basic
- // pArgs = lcl_translateUno2Basic( pUnoArgs );
-
delete pUnoArgs;
}
// JavaScript calls are ignored
@@ -274,3 +259,4 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index f0cc94b6ee19..85a90d2565e3 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <docary.hxx>
#include <xmloff/odffields.hxx>
#include <editsh.hxx>
-#include <errhdl.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <functional>
@@ -292,8 +292,7 @@ IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk)
return NAVIGATOR_REMINDER;
else
{
- OSL_ENSURE(false,
- "IDocumentMarkAccess::GetType(..)"
+ OSL_FAIL("IDocumentMarkAccess::GetType(..)"
" - unknown MarkType. This needs to be fixed!");
return UNO_BOOKMARK;
}
@@ -351,28 +350,28 @@ namespace sw { namespace mark
switch(eType)
{
case IDocumentMarkAccess::TEXT_FIELDMARK:
- pMark = shared_ptr<IMark>(new TextFieldmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new TextFieldmark(rPaM));
break;
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- pMark = shared_ptr<IMark>(new CheckboxFieldmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new CheckboxFieldmark(rPaM));
break;
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
- pMark = shared_ptr<IMark>(new NavigatorReminder(rPaM));
+ pMark = boost::shared_ptr<IMark>(new NavigatorReminder(rPaM));
break;
case IDocumentMarkAccess::BOOKMARK:
- pMark = shared_ptr<IMark>(new Bookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new Bookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::DDE_BOOKMARK:
- pMark = shared_ptr<IMark>(new DdeBookmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new DdeBookmark(rPaM));
break;
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- pMark = shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
- pMark = shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::UNO_BOOKMARK:
- pMark = shared_ptr<IMark>(new UnoMark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new UnoMark(rPaM));
break;
}
OSL_ENSURE(pMark.get(),
@@ -394,12 +393,10 @@ namespace sw { namespace mark
case IDocumentMarkAccess::BOOKMARK:
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- // if(dynamic_cast<IBookmark*>)
lcl_InsertMarkSorted(m_vBookmarks, pMark);
break;
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- // if(dynamic_cast<IFieldmark*>
lcl_InsertMarkSorted(m_vFieldmarks, pMark);
break;
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
@@ -418,6 +415,7 @@ namespace sw { namespace mark
OSL_TRACE("Fieldmarks");
lcl_DebugMarks(m_vFieldmarks);
#endif
+
return pMark.get();
}
@@ -609,7 +607,7 @@ namespace sw { namespace mark
{
// completely in range
- // --> OD 2009-08-07 #i92125#
+ // #i92125#
bool bKeepCrossRefBkmk( false );
{
if ( rStt == rEnd &&
@@ -627,7 +625,6 @@ namespace sw { namespace mark
pSaveBkmk->push_back(SaveBookmark(true, true, *pMark, rStt, pSttIdx));
vMarksToDelete.push_back(ppMark);
}
- // <--
}
else if(isPosInRange ^ isOtherPosInRange)
{
@@ -644,7 +641,7 @@ namespace sw { namespace mark
rEnd,
isPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos());
- // --> OD 2009-08-06 #i92125#
+ // #i92125#
// no move of position for cross-reference bookmarks,
// if move occurs inside a certain node
if ( ( IDocumentMarkAccess::GetType(*pMark) !=
@@ -661,17 +658,16 @@ namespace sw { namespace mark
// illegal selection? collapse the mark and restore sorting later
isSortingNeeded |= lcl_FixCorrectedMark(isPosInRange, isOtherPosInRange, pMark);
}
- // <--
}
}
// we just remembered the iterators to delete, so we do not need to search
- // for the shared_ptr<> (the entry in m_vMarks) again
+ // for the boost::shared_ptr<> (the entry in m_vMarks) again
// reverse iteration, since erasing an entry invalidates iterators
// behind it (the iterators in vMarksToDelete are sorted)
for(vector<const_iterator_t>::reverse_iterator pppMark = vMarksToDelete.rbegin();
pppMark != vMarksToDelete.rend();
- pppMark++)
+ ++pppMark)
{
deleteMark(*pppMark);
}
@@ -703,7 +699,6 @@ namespace sw { namespace mark
}
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- // if(dynamic_cast<IFieldmark*>
{
IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, *ppMark);
OSL_ENSURE(ppFieldmark != m_vFieldmarks.end(),
@@ -746,7 +741,7 @@ namespace sw { namespace mark
iterator_t pMarkHigh = m_vMarks.end();
iterator_t pMarkFound = find_if(
pMarkLow, pMarkHigh,
- bind(equal_to<const IMark*>(), bind(&shared_ptr<IMark>::get, _1), pMark));
+ bind(equal_to<const IMark*>(), bind(&boost::shared_ptr<IMark>::get, _1), pMark));
if(pMarkFound != pMarkHigh)
deleteMark(pMarkFound);
}
@@ -810,6 +805,7 @@ namespace sw { namespace mark
IFieldmark* MarkManager::getFieldmarkBefore(const SwPosition& rPos) const
{ return dynamic_cast<IFieldmark*>(lcl_getMarkBefore(m_vFieldmarks, rPos)); }
+
::rtl::OUString MarkManager::getUniqueMarkName(const ::rtl::OUString& rName) const
{
OSL_ENSURE(rName.getLength(),
@@ -836,10 +832,6 @@ namespace sw { namespace mark
}} // namespace ::sw::mark
-// old implementation
-
-//SV_IMPL_OP_PTRARR_SORT(SwBookmarks, SwBookmarkPtr)
-
#define PCURCRSR (_pCurrCrsr)
#define FOREACHPAM_START(pSttCrsr) \
{\
@@ -1496,10 +1488,10 @@ void _RestoreCntntIdx(SwDoc* pDoc,
case 0x0800:
case 0x0801:
{
- sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1656,10 +1648,10 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
case 0x0800:
case 0x0801:
{
- sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1744,3 +1736,5 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 95cdd4caed1b..7297413eb239 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,6 @@
#include <ndindex.hxx>
#include <swtable.hxx>
#include <ndtxt.hxx>
-#include <ndole.hxx>
#include <calc.hxx>
#include <frmfmt.hxx>
#include <cellfml.hxx>
@@ -52,7 +52,7 @@
#include <swtblfmt.hxx>
#include <tblsel.hxx>
#include <cellatr.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unochart.hxx>
@@ -78,7 +78,7 @@ sal_Bool SwTable::IsTblComplexForChart( const String& rSelection,
if( '>' == sBox.GetChar( sBox.Len()-1 ) ) sBox.Erase( sBox.Len()-1 );
xub_StrLen nTrenner = sBox.Search( ':' );
- ASSERT( STRING_NOTFOUND != nTrenner, "keine gueltige Selektion" );
+ OSL_ENSURE( STRING_NOTFOUND != nTrenner, "keine gueltige Selektion" );
pSttBox = GetTblBox( sBox.Copy( 0, nTrenner ));
pEndBox = GetTblBox( sBox.Copy( nTrenner+1 ));
@@ -224,7 +224,7 @@ SwChartDataProvider * SwDoc::GetChartDataProvider( bool bCreate ) const
{
// since there must be only one instance of this object per document
// we need a mutex here
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bCreate && !aChartDataProviderImplRef.get())
{
@@ -275,3 +275,4 @@ SwChartLockController_Helper & SwDoc::GetChartControllerHelper()
return *pChartControllerHelper;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index e0c550dff020..69c070ab3d20 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <vcl/vclenum.hxx>
#include <editeng/crsditem.hxx>
#include <editeng/colritem.hxx>
@@ -50,8 +49,11 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <vector>
+
using namespace ::com::sun::star;
+using ::std::vector;
class CompareLine
{
@@ -63,15 +65,13 @@ public:
virtual sal_Bool Compare( const CompareLine& rLine ) const = 0;
};
-DECLARE_LIST( CompareList, CompareLine* )
-
class CompareData
{
- sal_uLong* pIndex;
- sal_Bool* pChangedFlag;
+ size_t* pIndex;
+ bool* pChangedFlag;
protected:
- CompareList aLines;
+ vector< CompareLine* > aLines;
sal_uLong nSttLineNum;
// Anfang und Ende beschneiden und alle anderen in das
@@ -103,25 +103,25 @@ public:
// Eindeutigen Index fuer eine Line setzen. Gleiche Lines haben den
// selben Index; auch in den anderen CompareData!
- void SetIndex( sal_uLong nLine, sal_uLong nIndex );
- sal_uLong GetIndex( sal_uLong nLine ) const
- { return nLine < aLines.Count() ? pIndex[ nLine ] : 0; }
+ void SetIndex( size_t nLine, size_t nIndex );
+ size_t GetIndex( size_t nLine ) const
+ { return nLine < aLines.size() ? pIndex[ nLine ] : 0; }
// setze/erfrage ob eine Zeile veraendert ist
- void SetChanged( sal_uLong nLine, sal_Bool bFlag = sal_True );
- sal_Bool GetChanged( sal_uLong nLine ) const
+ void SetChanged( size_t nLine, bool bFlag = true );
+ bool GetChanged( size_t nLine ) const
{
- return (pChangedFlag && nLine < aLines.Count())
+ return (pChangedFlag && nLine < aLines.size())
? pChangedFlag[ nLine ]
: 0;
}
- sal_uLong GetLineCount() const { return aLines.Count(); }
+ size_t GetLineCount() const { return aLines.size(); }
sal_uLong GetLineOffset() const { return nSttLineNum; }
- const CompareLine* GetLine( sal_uLong nLine ) const
- { return aLines.GetObject( nLine ); }
+ const CompareLine* GetLine( size_t nLine ) const
+ { return aLines[ nLine ]; }
void InsertLine( CompareLine* pLine )
- { aLines.Insert( pLine, LIST_APPEND ); }
+ { aLines.push_back( pLine ); }
};
class Hash
@@ -195,12 +195,8 @@ public:
Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 );
};
-// ====================================================================
-
CompareLine::~CompareLine() {}
-// ----------------------------------------------------------------------
-
CompareData::CompareData()
: pIndex( 0 ), pChangedFlag( 0 ), nSttLineNum( 0 )
{
@@ -212,25 +208,25 @@ CompareData::~CompareData()
delete[] pChangedFlag;
}
-void CompareData::SetIndex( sal_uLong nLine, sal_uLong nIndex )
+void CompareData::SetIndex( size_t nLine, size_t nIndex )
{
if( !pIndex )
{
- pIndex = new sal_uLong[ aLines.Count() ];
- memset( pIndex, 0, aLines.Count() * sizeof( sal_uLong ) );
+ pIndex = new size_t[ aLines.size() ];
+ memset( pIndex, 0, aLines.size() * sizeof( size_t ) );
}
- if( nLine < aLines.Count() )
+ if( nLine < aLines.size() )
pIndex[ nLine ] = nIndex;
}
-void CompareData::SetChanged( sal_uLong nLine, sal_Bool bFlag )
+void CompareData::SetChanged( size_t nLine, bool bFlag )
{
if( !pChangedFlag )
{
- pChangedFlag = new sal_Bool[ aLines.Count() +1 ];
- memset( pChangedFlag, 0, aLines.Count() +1 * sizeof( sal_Bool ) );
+ pChangedFlag = new bool[ aLines.size() +1 ];
+ memset( pChangedFlag, 0, (aLines.size() +1) * sizeof( bool ) );
}
- if( nLine < aLines.Count() )
+ if( nLine < aLines.size() )
pChangedFlag[ nLine ] = bFlag;
}
@@ -312,8 +308,6 @@ void CompareData::CheckForChangesInLine( const CompareData& ,
{
}
-// ----------------------------------------------------------------------
-
Hash::Hash( sal_uLong nSize )
: nCount( 1 )
{
@@ -373,14 +367,14 @@ void Hash::CalcHashValue( CompareData& rData )
{
if( pHashArr )
{
- for( sal_uLong n = 0; n < rData.GetLineCount(); ++n )
+ for( size_t n = 0; n < rData.GetLineCount(); ++n )
{
const CompareLine* pLine = rData.GetLine( n );
- ASSERT( pLine, "wo ist die Line?" );
+ OSL_ENSURE( pLine, "wo ist die Line?" );
sal_uLong nH = pLine->GetHashValue();
sal_uLong* pFound = &pHashArr[ nH % nPrime ];
- sal_uLong i;
+ size_t i;
for( i = *pFound; ; i = pDataArr[i].nNext )
if( !i )
{
@@ -400,8 +394,6 @@ void Hash::CalcHashValue( CompareData& rData )
}
}
-// ----------------------------------------------------------------------
-
Compare::Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 )
{
MovedData *pMD1, *pMD2;
@@ -448,8 +440,6 @@ Compare::Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 )
delete pMD2;
}
-
-
void Compare::CountDifference( const CompareData& rData, sal_uLong* pCounts )
{
sal_uLong nLen = rData.GetLineCount();
@@ -588,8 +578,6 @@ void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard )
}
}
-// ----------------------------------------------------------------------
-
Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard )
: pIndex( 0 ), pLineNum( 0 ), nCount( 0 )
{
@@ -622,9 +610,7 @@ Compare::MovedData::~MovedData()
delete pLineNum;
}
-// ----------------------------------------------------------------------
-
- // Suche die verschobenen Lines
+// Suche die verschobenen Lines
Compare::CompareSequence::CompareSequence(
CompareData& rD1, CompareData& rD2,
const MovedData& rMD1, const MovedData& rMD2 )
@@ -708,26 +694,22 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
for (c = 1;; ++c)
{
long d; /* Active diagonal. */
- long big_snake = 0;
/* Extend the top-down search by an edit step in each diagonal. */
fmin > dmin ? pFDiag[--fmin - 1] = -1 : ++fmin;
fmax < dmax ? pFDiag[++fmax + 1] = -1 : --fmax;
for (d = fmax; d >= fmin; d -= 2)
{
- long x, y, oldx, tlo = pFDiag[d - 1], thi = pFDiag[d + 1];
+ long x, y, tlo = pFDiag[d - 1], thi = pFDiag[d + 1];
if (tlo >= thi)
x = tlo + 1;
else
x = thi;
- oldx = x;
y = x - d;
while( sal_uLong(x) < nEnd1 && sal_uLong(y) < nEnd2 &&
rMoved1.GetIndex( x ) == rMoved2.GetIndex( y ))
++x, ++y;
- if (x - oldx > 20)
- big_snake = 1;
pFDiag[d] = x;
if( odd && bmin <= d && d <= bmax && pBDiag[d] <= pFDiag[d] )
{
@@ -741,19 +723,16 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
bmax < dmax ? pBDiag[++bmax + 1] = INT_MAX : --bmax;
for (d = bmax; d >= bmin; d -= 2)
{
- long x, y, oldx, tlo = pBDiag[d - 1], thi = pBDiag[d + 1];
+ long x, y, tlo = pBDiag[d - 1], thi = pBDiag[d + 1];
if (tlo < thi)
x = tlo;
else
x = thi - 1;
- oldx = x;
y = x - d;
while( sal_uLong(x) > nStt1 && sal_uLong(y) > nStt2 &&
rMoved1.GetIndex( x - 1 ) == rMoved2.GetIndex( y - 1 ))
--x, --y;
- if (oldx - x > 20)
- big_snake = 1;
pBDiag[d] = x;
if (!odd && fmin <= d && d <= fmax && pBDiag[d] <= pFDiag[d])
{
@@ -840,8 +819,6 @@ void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
}
}
-/* */
-
class SwCompareLine : public CompareLine
{
const SwNode& rNode;
@@ -892,8 +869,6 @@ public:
void SetRedlinesToDoc( sal_Bool bUseDocInfo );
};
-// ----------------------------------------------------------------
-
SwCompareLine::SwCompareLine( const SwNode& rNd )
: rNode( rNd )
{
@@ -1245,8 +1220,6 @@ sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
return bRet;
}
-// ----------------------------------------------------------------
-
SwCompareData::~SwCompareData()
{
if( pDelRing )
@@ -1291,7 +1264,6 @@ sal_uLong SwCompareData::PrevIdx( const SwNode* pNd )
return pNd->GetIndex() - 1;
}
-
void SwCompareData::CheckRanges( CompareData& rData )
{
const SwNodes& rSrcNds = ((SwCompareData&)rData).rDoc.GetNodes();
@@ -1345,7 +1317,6 @@ void SwCompareData::CheckRanges( CompareData& rData )
}
}
-
void SwCompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd )
{
SwPaM* pTmp = new SwPaM( ((SwCompareLine*)GetLine( nStt ))->GetNode(), 0,
@@ -1436,8 +1407,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
{
SwPaM* pTmp = pDelRing;
- // Bug #83296#: get the Author / TimeStamp from the "other"
- // document info
+ // get the Author / TimeStamp from the "other" document info
sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
DateTime aTimeStamp;
SwDocShell *pDocShell(rDoc.GetDocShell());
@@ -1571,11 +1541,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
}
}
-/* */
-
-
-
- // returnt (?die Anzahl der Unterschiede?) ob etwas unterschiedlich ist
+// returnt (?die Anzahl der Unterschiede?) ob etwas unterschiedlich ist
long SwDoc::CompareDoc( const SwDoc& rDoc )
{
if( &rDoc == this )
@@ -1619,7 +1585,6 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
return nRet;
}
-
class _SaveMergeRedlines : public Ring
{
const SwRedline* pSrcRedl;
@@ -1880,4 +1845,4 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
return nRet;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 6585b3359004..8f59503b2455 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -356,3 +357,4 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
return GetEditShell(0);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index bef9ea1f254f..10892ca2a611 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <stdlib.h>
-#ifndef _APP_HXX
#include <vcl/svapp.hxx>
-#endif
#include <tools/urlobj.hxx>
#define _SVSTDARR_STRINGS
@@ -416,3 +415,4 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 52228110afb5..6133185a6b7a 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,8 +97,8 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
//Raender haben eine defaultmaessige Mindestgroesse.
//wenn der Drucker einen groesseren Rand vorgibt, so
//ist mir dass auch recht.
- // MIB 06/25/2002, #99397#: The HTML page desc had A4 as page size
- // always. This has been changed to take the page size from the printer.
+ // The HTML page desc had A4 as page size always.
+ // This has been changed to take the page size from the printer.
// Unfortunately, the margins of the HTML page desc are smaller than
// the margins used here in general, so one extra case is required.
// In the long term, this needs to be changed to always keep the
@@ -140,9 +141,6 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
|*
|* SwDoc::ChgPageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 01. Mar. 95
-|*
|*************************************************************************/
void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
@@ -154,7 +152,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!!
//Die interressanten Attribute uebernehmen.
- sal_uInt16 __READONLY_DATA aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
+ sal_uInt16 const aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
RES_COL, RES_COL,
RES_FRAMEDIR, RES_FRAMEDIR,
@@ -198,7 +196,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
- ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
+ OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
@@ -436,8 +434,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
|*
|* Beschreibung Alle Descriptoren, deren Follow auf den zu loeschenden
|* zeigen muessen angepasst werden.
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung JP 04.09.95
|*
|*************************************************************************/
@@ -485,7 +481,6 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
}
}
-// #116530#
void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
sal_uInt16 nOp)
{
@@ -506,18 +501,16 @@ void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
{
- ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
- ASSERT( i != 0, "Default Pagedesc loeschen is nicht." );
+ OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
+ OSL_ENSURE( i != 0, "Default Pagedesc loeschen is nicht." );
if ( i == 0 )
return;
SwPageDesc *pDel = aPageDescs[i];
- // -> #116530#
if (bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_PAGE,
SFX_STYLESHEET_ERASED);
- // <- #116530#
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -538,9 +531,6 @@ void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
|*
|* SwDoc::MakePageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 20. Aug. 93
-|*
|*************************************************************************/
sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
@@ -573,11 +563,9 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
}
aPageDescs.Insert( pNew, aPageDescs.Count() );
- // -> #116530#
if (bBroadcast)
BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PAGE,
SFX_STYLESHEET_CREATED);
- // <- #116530#
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -608,8 +596,6 @@ SwPageDesc* SwDoc::FindPageDescByName( const String& rName, sal_uInt16* pPos ) c
/******************************************************************************
* Methode : void SwDoc::PrtDataChanged()
* Beschreibung:
- * Erstellt : OK 27.10.94 10:20
- * Aenderung : MA 26. Mar. 98
******************************************************************************/
void SwDoc::PrtDataChanged()
@@ -617,8 +603,8 @@ void SwDoc::PrtDataChanged()
//!!!!!!!! Bei Aenderungen hier bitte ggf. InJobSetup im Sw3io mitpflegen
// --> FME 2005-01-21 #i41075#
- ASSERT( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
- 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" )
+ OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
+ 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" );
// <--
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
SwWait *pWait = 0;
@@ -764,19 +750,6 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
//Wenn es keine Benachrichtigung wuenscht
if ( xObj.is() )
{
- //TODO/LATER: needs MiscStatus for ResizeOnPrinterChange
- /*
- if ( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xRef->GetMiscStatus())
- {
- if ( pOLENd->GetFrm() )
- {
- xObj->OnDocumentPrinterChanged( pPrt );
- pShell->CalcAndSetScale( xObj );//Client erzeugen lassen.
- }
- else
- pOLENd->SetOLESizeInvalid( sal_True );
- }
- else */
pGlobalOLEExcludeList->Insert(
new SvGlobalName( aName ),
pGlobalOLEExcludeList->Count() );
@@ -815,20 +788,6 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
//Wenn es keine Benachrichtigung wuenscht
if( pOLENd->GetOLEObj().GetOleRef().is() ) //Kaputt?
{
- //TODO/LATER: needs MiscStatus for ResizeOnPrinterChange
- /*
- if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE &
- xRef->GetMiscStatus() )
- {
- if( pOLENd->GetFrm() )
- {
- xRef->OnDocumentPrinterChanged( pPrt );
- pSh->CalcAndSetScale( xRef );//Client erzeugen lassen.
- }
- else
- pOLENd->SetOLESizeInvalid( sal_True );
- }*/
- // repaint it
pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
@@ -869,12 +828,12 @@ SwPageDesc * SwDoc::GetPageDesc( const String & rName )
return aResult;
}
-void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast ) // #116530#
+void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast )
{
sal_uInt16 nI;
if (FindPageDesc(rName, &nI))
- DelPageDesc(nI, bBroadcast); // #116530#
+ DelPageDesc(nI, bBroadcast);
}
void SwDoc::ChgPageDesc( const String & rName, const SwPageDesc & rDesc)
@@ -944,3 +903,5 @@ sal_Bool SwDoc::IsSquaredPageMode() const
(const SwTextGridItem&)GetDefault( RES_TEXTGRID );
return rGrid.IsSquaredMode();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index b18ccb6af8c4..bf2dcbbd93cb 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,12 +67,11 @@
#include <svx/svdetc.hxx>
#include <editeng/fhgtitem.hxx>
#include <svx/svdpagv.hxx>
-#include <dcontact.hxx>
#include <txtfrm.hxx>
-#include <frmfmt.hxx>
#include <editeng/frmdiritem.hxx>
#include <fmtornt.hxx>
#include <svx/svditer.hxx>
+
#include <vector>
#include <switerator.hxx>
@@ -85,11 +85,8 @@ SV_IMPL_VARARR_SORT( _ZSortFlys, _ZSortFly )
|*
|* SwDoc::GroupSelection / SwDoc::UnGroupSelection
|*
-|* Ersterstellung JP 21.08.95
-|* Letzte Aenderung JP 21.08.95
-|*
|*************************************************************************/
-// OD 2004-04-01 #i26791# - local method to determine positioning and
+// local method to determine positioning and
// alignment attributes for a drawing object, which is newly connected to
// the layout. Used for a newly formed group object <SwDoc::GroupSelection(..)>
// and the members of a destroyed group <SwDoc::UnGroupSelection(..)>
@@ -97,35 +94,32 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
const SdrObject& _rSdrObj )
{
const SwContact* pContact = GetUserCall( &_rSdrObj );
- ASSERT( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
+ OSL_ENSURE( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
// determine position of new group object relative to its anchor frame position
SwTwips nHoriRelPos = 0;
SwTwips nVertRelPos = 0;
{
const SwFrm* pAnchorFrm = pContact->GetAnchoredObj( &_rSdrObj )->GetAnchorFrm();
- ASSERT( !pAnchorFrm ||
+ OSL_ENSURE( !pAnchorFrm ||
!pAnchorFrm->IsTxtFrm() ||
!static_cast<const SwTxtFrm*>(pAnchorFrm)->IsFollow(),
"<lcl_AdjustPositioningAttr(..)> - anchor frame is a follow. Please inform OD." );
bool bVert = false;
bool bR2L = false;
- // --> OD 2005-05-10 #i45952# - use anchor position of
- // anchor frame, if it exist.
+ // #i45952# - use anchor position of anchor frame, if it exist.
Point aAnchorPos;
if ( pAnchorFrm )
{
- // --> OD 2005-05-10 #i45952#
+ // #i45952#
aAnchorPos = pAnchorFrm->GetFrmAnchorPos( ::HasWrap( &_rSdrObj ) );
- // <--
bVert = pAnchorFrm->IsVertical();
bR2L = pAnchorFrm->IsRightToLeft();
}
else
{
- // --> OD 2005-05-10 #i45952#
+ // #i45952#
aAnchorPos = _rSdrObj.GetAnchorPos();
- // <--
// If no anchor frame exist - e.g. because no layout exists - the
// default layout direction is taken.
const SvxFrameDirectionItem* pDirItem =
@@ -137,9 +131,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
// vertical from left-to-right - Badaa: supported now!
bVert = true;
bR2L = true;
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- //ASSERT( false, "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
- //End
+ OSL_FAIL( "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
}
break;
case FRMDIR_VERT_TOP_RIGHT:
@@ -196,10 +188,9 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
_pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
_pFrmFmt->SetFmtAttr( SwFmtVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
- // --> OD 2005-03-11 #i44334#, #i44681# - positioning attributes already set
+ // #i44334#, #i44681# - positioning attributes already set
_pFrmFmt->PosAttrSet();
- // <--
- // --> OD 2004-10-01 #i34750# - keep current object rectangle for drawing
+ // #i34750# - keep current object rectangle for drawing
// objects. The object rectangle is used on events from the drawing layer
// to adjust the positioning attributes - see <SwDrawContact::_Changed(..)>.
{
@@ -213,13 +204,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
->SetLastObjRect( aObjRect.SVRect() );
}
}
- // <--
}
SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
{
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
+ // replace marked 'virtual' drawing objects by the corresponding 'master'
+ // drawing objects.
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
@@ -237,28 +227,26 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
? 0
: new SwUndoDrawGroup( (sal_uInt16)rMrkList.GetMarkCount() );
- // --> OD 2005-08-16 #i53320#
+ // #i53320#
bool bGroupMembersNotPositioned( false );
{
SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<SwAnchoredDrawObject*>(pMyContact->GetAnchoredObj( pObj ));
bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned();
}
- // <--
//ContactObjekte und Formate vernichten.
for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- // --> OD 2005-08-16 #i53320#
-#ifdef DBG_UTIL
+ // #i53320#
+#if OSL_DEBUG_LEVEL > 1
SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ));
- ASSERT( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
+ OSL_ENSURE( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
"<SwDoc::GroupSelection(..)> - group members have different positioning status!" );
#endif
- // <--
pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
//loescht sich selbst!
@@ -270,41 +258,37 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
else
DelFrmFmt( pFmt );
- // --> OD 2005-05-10 #i45952# - re-introduce position
- // normalization of group member objects, because its anchor position
- // is cleared, when they are grouped.
+ // #i45952# - re-introduce position normalization of group member
+ // objects, because its anchor position is cleared, when they are
+ // grouped.
Point aAnchorPos( pObj->GetAnchorPos() );
pObj->NbcSetAnchorPos( Point( 0, 0 ) );
pObj->NbcMove( Size( aAnchorPos.X(), aAnchorPos.Y() ) );
- // <--
}
pFmt = MakeDrawFrmFmt( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "DrawObject" )),
GetDfltFrmFmt() );
pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
SdrObject* pNewGroupObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
pNewContact = new SwDrawContact( pFmt, pNewGroupObj );
- // --> OD 2004-11-22 #i35635#
+ // #i35635#
pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
- // <--
pNewContact->ConnectToLayout();
- // --> OD 2005-08-16 #i53320# - No adjustment of the positioning and
- // alignment attributes, if group members aren't positioned yet.
+ // #i53320# - No adjustment of the positioning and alignment
+ // attributes, if group members aren't positioned yet.
if ( !bGroupMembersNotPositioned )
{
- // OD 2004-04-01 #i26791# - Adjust positioning and alignment attributes.
+ // #i26791# - Adjust positioning and alignment attributes.
lcl_AdjustPositioningAttr( pFmt, *pNewGroupObj );
}
- // <--
if( pUndo )
{
@@ -320,7 +304,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
}
rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
}
return pNewContact;
@@ -335,20 +319,16 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
GetIDocumentUndoRedo().ClearRedo();
}
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
+ // replace marked 'virtual' drawing objects by the corresponding 'master'
+ // drawing objects.
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- // --> OD 2006-11-01 #130889#
std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() );
- // <--
if ( nMarkCount )
{
- // --> OD 2006-11-01 #130889#
pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount];
- // <--
SdrObject *pMyObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pMyObj->GetUpGroup() )
{
@@ -376,24 +356,10 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
GetDfltFrmFmt() );
pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
- // --> OD 2006-11-01 #130889#
- // creation of <SwDrawContact> instances for the group
- // members and its connection to the Writer layout is
- // done after intrinsic ungrouping.
-// SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj );
-// // --> OD 2004-11-22 #i35635#
-// pContact->MoveObjToVisibleLayer( pSubObj );
-// // <--
-// pContact->ConnectToLayout();
-// // OD 2004-04-07 #i26791# - Adjust positioning and
-// // alignment attributes.
-// lcl_AdjustPositioningAttr( pFmt, *pSubObj );
pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
- // <--
if( bUndo )
pUndo->AddObj( i2, pFmt );
@@ -403,7 +369,6 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
}
}
rDrawView.UnGroupMarked();
- // --> OD 2006-11-01 #130889#
// creation of <SwDrawContact> instances for the former group members and
// its connection to the Writer layout.
for ( sal_uInt32 i = 0; i < nMarkCount; ++i )
@@ -433,16 +398,12 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
}
}
delete [] pFmtsAndObjs;
- // <--
}
/*************************************************************************
|*
|* SwDoc::DeleteSelection()
|*
-|* Ersterstellung MA 14. Nov. 95
-|* Letzte Aenderung MA 14. Nov. 95
-|*
|*************************************************************************/
sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
@@ -506,14 +467,13 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
if( pContact ) // natuerlich nicht bei gruppierten Objekten
{
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- // OD 18.06.2003 #108784# - before delete of selection
- // is performed, marked <SwDrawVirtObj>-objects have to
- // be replaced by its reference objects.
- // Thus, assert, if a <SwDrawVirt>-object is found in the mark list.
+ // before delete of selection is performed, marked
+ // <SwDrawVirtObj>-objects have to be replaced by its
+ // reference objects. Thus, assert, if a
+ // <SwDrawVirt>-object is found in the mark list.
if ( pObj->ISA(SwDrawVirtObj) )
{
- ASSERT( false,
- "<SwDrawVirtObj> is still marked for delete. application will crash!" );
+ OSL_FAIL( "<SwDrawVirtObj> is still marked for delete. application will crash!" );
}
//loescht sich selbst!
pContact->Changed(*pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
@@ -545,9 +505,6 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
|*
|* SwDoc::DeleteSelection()
|*
-|* Ersterstellung JP 11.01.96
-|* Letzte Aenderung JP 11.01.96
-|*
|*************************************************************************/
_ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
@@ -582,7 +539,7 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
nOrdNum = pContact->GetMaster()->GetOrdNum();
}
else {
- ASSERT( !this, "was ist das fuer ein Format?" );
+ OSL_ENSURE( !this, "was ist das fuer ein Format?" );
}
}
@@ -591,7 +548,6 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// des Drawing Layers auftrat. In diesem Fall wird der Layer komplett
// neu aufgebaut.
-// #75371#
#include <svx/sxenditm.hxx>
void SwDoc::InitDrawModel()
@@ -606,11 +562,9 @@ void SwDoc::InitDrawModel()
//DrawPool und EditEnginePool anlegen, diese gehoeren uns und werden
//dem Drawing nur mitgegeben. Im ReleaseDrawModel werden die Pools wieder
//zerstoert.
- // 17.2.99: for Bug 73110 - for loading the drawing items. This must
- // be loaded without RefCounts!
+ // for loading the drawing items. This must be loaded without RefCounts!
SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
- // #75371# change DefaultItems for the SdrEdgeObj distance items
- // to TWIPS.
+ // change DefaultItems for the SdrEdgeObj distance items to TWIPS.
if(pSdrPool)
{
const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
@@ -631,7 +585,7 @@ void SwDoc::InitDrawModel()
else
pSdrPool->FreezeIdRanges();
- // SJ: #95129# set FontHeight pool defaults without changing static SdrEngineDefaults
+ // set FontHeight pool defaults without changing static SdrEngineDefaults
GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create DrawDocument" );
@@ -651,8 +605,7 @@ void SwDoc::InitDrawModel()
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
nControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
- // OD 25.06.2003 #108784# - add invisible layers corresponding to the
- // visible ones.
+ // add invisible layers corresponding to the visible ones.
{
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
nInvisibleHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
@@ -711,12 +664,7 @@ void SwDoc::InitDrawModel()
}
}
-/** method to notify drawing page view about the invisible layers
-
- OD 26.06.2003 #108784#
-
- @author OD
-*/
+/** method to notify drawing page view about the invisible layers */
void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
{
String sLayerNm;
@@ -732,10 +680,7 @@ void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
/** method to determine, if a layer ID belongs to the visible ones.
- OD 25.06.2003 #108784#
Note: If given layer ID is unknown, method asserts and returns <false>.
-
- @author OD
*/
bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
{
@@ -755,7 +700,7 @@ bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
}
else
{
- ASSERT( false, "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." );
+ OSL_FAIL( "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." );
bRetVal = false;
}
@@ -764,11 +709,8 @@ bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
/** method to determine, if the corresponding visible layer ID for a invisible one.
- OD 25.06.2003 #108784#
Note: If given layer ID is a visible one, method returns given layer ID.
Note: If given layer ID is unknown, method returns given layer ID.
-
- @author OD
*/
SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId )
{
@@ -790,12 +732,12 @@ SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisible
_nInvisibleLayerId == GetHellId() ||
_nInvisibleLayerId == GetControlsId() )
{
- ASSERT( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." );
+ OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." );
nVisibleLayerId = _nInvisibleLayerId;
}
else
{
- ASSERT( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." );
+ OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." );
nVisibleLayerId = _nInvisibleLayerId;
}
@@ -804,11 +746,8 @@ SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisible
/** method to determine, if the corresponding invisible layer ID for a visible one.
- OD 25.06.2003 #108784#
Note: If given layer ID is a invisible one, method returns given layer ID.
Note: If given layer ID is unknown, method returns given layer ID.
-
- @author OD
*/
SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId )
{
@@ -830,12 +769,12 @@ SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLa
_nVisibleLayerId == GetInvisibleHellId() ||
_nVisibleLayerId == GetInvisibleControlsId() )
{
- ASSERT( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." );
+ OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." );
nInvisibleLayerId = _nVisibleLayerId;
}
else
{
- ASSERT( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." );
+ OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." );
nInvisibleLayerId = _nVisibleLayerId;
}
@@ -854,9 +793,9 @@ void SwDoc::ReleaseDrawModel()
delete pDrawModel; pDrawModel = 0;
SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
- ASSERT( pSdrPool, "missing Pool" );
+ OSL_ENSURE( pSdrPool, "missing Pool" );
SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
- ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
+ OSL_ENSURE( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
pSdrPool->Delete(); //Erst die Items vernichten lassen,
//dann erst die Verkettung loesen
GetAttrPool().SetSecondaryPool( 0 ); //Der ist ein muss!
@@ -871,7 +810,7 @@ void SwDoc::ReleaseDrawModel()
SdrModel* SwDoc::_MakeDrawModel()
{
- ASSERT( !pDrawModel, "_MakeDrawModel: Why?" );
+ OSL_ENSURE( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
if ( pCurrentView )
{
@@ -989,7 +928,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
}
else
{
- DBG_ERROR("unbekannter Feldbefehl");
+ OSL_FAIL("unbekannter Feldbefehl");
pInfo->SetRepresentation( String( '?' ) );
}
}
@@ -1009,7 +948,7 @@ SdrLayerID SwDoc::GetInvisibleHellId() const { return nInvisibleHell; }
SdrLayerID SwDoc::GetInvisibleControlsId() const { return nInvisibleControls; }
SdrModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
-// --> OD 2006-03-14 #i62875#
+// #i62875#
namespace docfunc
{
bool ExistsDrawObjs( SwDoc& p_rDoc )
@@ -1064,8 +1003,7 @@ namespace docfunc
{
if ( !pAnchoredDrawObj )
{
- ASSERT( false,
- "<docfunc::AllDrawObjsOnPage() - missing anchored draw object" );
+ OSL_FAIL( "<docfunc::AllDrawObjsOnPage() - missing anchored draw object" );
bAllDrawObjsOnPage = false;
break;
}
@@ -1099,5 +1037,5 @@ namespace docfunc
return bAllDrawObjsOnPage;
}
}
-// <--
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index ef5ecb8c255c..8d9849f547b8 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,6 @@
#include <UndoDelete.hxx>
#include <breakit.hxx>
#include <hhcwrp.hxx>
-#include <breakit.hxx>
#include <vcl/msgbox.hxx>
#include "comcore.hrc"
#include "editsh.hxx"
@@ -86,7 +86,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
using namespace ::com::sun::star::i18n;
-//using namespace ::utl;
#ifndef S2U
#define S2U(rString) OUString::createFromAscii(rString)
#endif
@@ -190,8 +189,6 @@ void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rStart )
}
}
-// -----------------------------------------------------------------
-
void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
const SwNodeIndex* pInsertPos )
{
@@ -291,7 +288,6 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
SwFmtAnchor aAnchor( *pAnchor );
aAnchor.SetAnchor( &aPos );
pFmt->SetFmtAttr( aAnchor );
-// ((SwFmtAnchor*)pAnchor)->SetAnchor( &aPos );
}
}
else if( ( rSttNdIdx.GetIndex() + nSttOff <= pAPos->nNode.GetIndex()
@@ -309,11 +305,8 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
}
}
-// -----------------------------------------------------------------
-
// loesche und verschiebe alle "Fly's am Absatz", die in der SSelection
// liegen. Steht am SPoint ein Fly, wird dieser auf den Mark verschoben.
-
void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
const SwNodeIndex& rPtNdIdx )
{
@@ -360,17 +353,14 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
pDoc->DelLayoutFmt( pFmt );
- // --> FME 2004-10-06 #117913# DelLayoutFmt can also
- // trigger the deletion of objects.
+ // DelLayoutFmt can also trigger the deletion of objects.
if( i > rTbl.Count() )
i = rTbl.Count();
- // <--
}
}
}
}
-
bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
const SwNodeIndex& rInsPos,
SwFtnIdxs& rFtnArr, SwFtnIdxs& rSaveArr,
@@ -569,7 +559,6 @@ void lcl_RestoreRedlines( SwDoc* pDoc, const SwPosition& rPos, _SaveRedlines& rA
pDoc->SetRedlineMode_intern( eOld );
}
-
void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
{
SwDoc* pDoc = rRg.aStart.GetNode().GetDoc();
@@ -605,7 +594,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
pTmpPos->nNode.GetNode().GetCntntNode(), 0 );
_SaveRedline* pSave = new _SaveRedline( pNewRedl, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
pTmpPos = pTmp->End();
@@ -629,7 +617,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
{
// gesamt verschieben
_SaveRedline* pSave = new _SaveRedline( pTmp, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
}
else
@@ -642,7 +629,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
pTmpPos->nNode.GetNode().GetCntntNode(), 0 );
_SaveRedline* pSave = new _SaveRedline( pNewRedl, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
pTmpPos = pTmp->Start();
@@ -674,12 +660,10 @@ void lcl_RestoreRedlines( SwDoc* pDoc, sal_uInt32 nInsPos, _SaveRedlines& rArr )
pDoc->SetRedlineMode_intern( eOld );
}
-// ------------------------------------------------------------------------
// #i59534: Redo of insertion of multiple text nodes runs into trouble
// because of unnecessary expanded redlines
// From now on this class saves the redline positions of all redlines which ends exact at the
// insert position (node _and_ content index)
-
_SaveRedlEndPosForRestore::_SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx, xub_StrLen nCnt )
: pSavArr( 0 ), pSavIdx( 0 ), nSavCntnt( nCnt )
{
@@ -728,14 +712,11 @@ void _SaveRedlEndPosForRestore::_Restore()
}
}
-
-// ------------------------------------------------------------------------
-
// Loeschen einer vollstaendigen Section des NodesArray.
// Der uebergebene Node steht irgendwo in der gewuenschten Section
void SwDoc::DeleteSection( SwNode *pNode )
{
- ASSERT( pNode, "Kein Node uebergeben." );
+ OSL_ENSURE( pNode, "Kein Node uebergeben." );
SwStartNode* pSttNd = pNode->IsStartNode() ? (SwStartNode*)pNode
: pNode->StartOfSectionNode();
SwNodeIndex aSttIdx( *pSttNd ), aEndIdx( *pNode->EndOfSectionNode() );
@@ -754,7 +735,6 @@ void SwDoc::DeleteSection( SwNode *pNode )
GetNodes().DelNodes( aSttIdx, aEndIdx.GetIndex() - aSttIdx.GetIndex() + 1 );
}
-
void SwDoc::SetModified(SwPaM &rPaM)
{
SwDataChanged aTmp( rPaM, 0 );
@@ -764,7 +744,6 @@ void SwDoc::SetModified(SwPaM &rPaM)
/*************************************************************************
* SwDoc::Overwrite()
************************************************************************/
-
bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
{
SwPosition& rPt = *(SwPosition*)rRg.GetPoint();
@@ -867,7 +846,6 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
return sal_True;
}
-
bool SwDoc::MoveAndJoin( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
{
SwNodeIndex aIdx( rPaM.Start()->nNode );
@@ -1025,7 +1003,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
else
rPaM.DeleteMark();
- ASSERT( *aSavePam.GetMark() == rPos ||
+ OSL_ENSURE( *aSavePam.GetMark() == rPos ||
( aSavePam.GetMark()->nNode.GetNode().GetCntntNode() == NULL ),
"PaM wurde nicht verschoben, am Anfang/Ende keine ContentNodes?" );
*aSavePam.GetMark() = rPos;
@@ -1067,7 +1045,6 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
}
bJoin = sal_False;
}
-// else if( !bCorrSavePam && !pSavePam->Move( fnMoveForward, fnGoCntnt ))
else if ( !aSavePam.Move( fnMoveForward, fnGoCntnt ) )
{
aSavePam.GetPoint()->nNode++;
@@ -1086,11 +1063,9 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
{
if( pTNd->CanJoinNext())
{
- // --> OD 2009-08-20 #i100466#
// Always join next, because <pTNd> has to stay as it is.
// A join previous from its next would more or less delete <pTNd>
pTNd->JoinNext();
- // <--
bRemove = false;
}
}
@@ -1279,8 +1254,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
return sal_True;
}
-/* #107318# Convert list of ranges of whichIds to a corresponding list
- of whichIds*/
+// Convert list of ranges of whichIds to a corresponding list of whichIds
SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
{
SvUShorts * pResult = new SvUShorts();
@@ -1288,7 +1262,7 @@ SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
int i = 0;
while (pRanges[i] != 0)
{
- ASSERT(pRanges[i+1] != 0, "malformed ranges");
+ OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges");
for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
pResult->Insert(j, pResult->Count());
@@ -1340,7 +1314,7 @@ void lcl_GetJoinFlags( SwPaM& rPam, sal_Bool& rJoinTxt, sal_Bool& rJoinPrev )
if( bExchange )
rPam.Exchange();
rJoinPrev = rPam.GetPoint() == pStt;
- ASSERT( !pStt->nContent.GetIndex() &&
+ OSL_ENSURE( !pStt->nContent.GetIndex() &&
pEndNd->GetTxt().Len() != pEnd->nContent.GetIndex()
? rPam.GetPoint()->nNode < rPam.GetMark()->nNode
: rPam.GetPoint()->nNode > rPam.GetMark()->nNode,
@@ -1438,7 +1412,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
pDelNd->FmtToTxtAttr( pTxtNd );
else
{
- /* #107318# This case was missed:
+ /* This case was missed:
<something></something> <-- pTxtNd
<other>ccc</other> <-- pDelNd
@@ -1464,8 +1438,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
}
pDoc->CorrRel( aIdx, *rPam.GetPoint(), 0, sal_True );
- // --> OD 2009-08-20 #i100466#
- // adjust given <rPam>, if it does not belong to the cursors
+ // #i100466# adjust given <rPam>, if it does not belong to the cursors
if ( pDelNd == rPam.GetBound( sal_True ).nContent.GetIdxReg() )
{
rPam.GetBound( sal_True ) = SwPosition( SwNodeIndex( *pTxtNd ), SwIndex( pTxtNd ) );
@@ -1474,7 +1447,6 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
{
rPam.GetBound( sal_False ) = SwPosition( SwNodeIndex( *pTxtNd ), SwIndex( pTxtNd ) );
}
- // <--
pTxtNd->JoinNext();
}
}
@@ -1501,7 +1473,7 @@ lcl_CalcBreaks( ::std::vector<xub_StrLen> & rBreaks, SwPaM const & rPam )
SwTxtAttr const * const pAttr( pTxtNode->GetTxtAttrForCharAt(i) );
if (pAttr && pAttr->GetEnd() && (*pAttr->GetEnd() > nEnd))
{
- ASSERT(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
+ OSL_ENSURE(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
rBreaks.push_back(i);
}
}
@@ -1554,10 +1526,9 @@ bool lcl_DoWithBreaks(SwDoc & rDoc, SwPaM & rPam,
return bRet;
}
-
bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
{
- ASSERT( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
+ OSL_ENSURE( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
{
SwUndoRedlineDelete* pUndo = 0;
@@ -1616,12 +1587,12 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
{
sal_Bool bJoinTxt, bJoinPrev;
lcl_GetJoinFlags( rPam, bJoinTxt, bJoinPrev );
- // --> OD 2009-08-20 #i100466#
+ // #i100466#
if ( bForceJoinNext )
{
bJoinPrev = sal_False;
}
- // <--
+
{
bool const bSuccess( DeleteRangeImpl( rPam ) );
if (!bSuccess)
@@ -1835,8 +1806,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
return true;
}
-// OD 2009-08-20 #i100466#
-// Add handling of new optional parameter <bForceJoinNext>
+// #i100466# Add handling of new optional parameter <bForceJoinNext>
bool SwDoc::DeleteAndJoin( SwPaM & rPam,
const bool bForceJoinNext )
{
@@ -1880,7 +1850,6 @@ void lcl_syncGrammarError( SwTxtNode &rTxtNode, linguistic2::ProofreadingResult&
rResult.aErrors.realloc( j );
}
-
uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< XSpellChecker1 > &xSpeller,
sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
@@ -1997,12 +1966,11 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *((SwTxtNode*)pNd), aExpandText, pConversionMap );
// get error position of cursor in XFlatParagraph
- sal_Int32 nGrammarErrorPosInText;
linguistic2::ProofreadingResult aResult;
sal_Int32 nGrammarErrors;
do
{
- nGrammarErrorPosInText = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nBeginGrammarCheck );
+ ModelToViewHelper::ConvertToViewPosition( pConversionMap, nBeginGrammarCheck );
aResult = xGCIterator->checkSentenceAtPosition(
xDoc, xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 );
@@ -2097,8 +2065,8 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos,
// Folgende Bedingungen muessen eingehalten werden:
// 1) es gibt mindestens eine Selektion
// 2) SPoint() == Start()
- ASSERT( pPam->HasMark(), "SwDoc::Hyphenate: blowing in the wind");
- ASSERT( *pPam->GetPoint() <= *pPam->GetMark(),
+ OSL_ENSURE( pPam->HasMark(), "SwDoc::Hyphenate: blowing in the wind");
+ OSL_ENSURE( *pPam->GetPoint() <= *pPam->GetMark(),
"SwDoc::Hyphenate: New York, New York");
const SwPosition *pPoint = pPam->GetPoint();
@@ -2133,7 +2101,7 @@ void SwHyphArgs::SetPam( SwPaM *pPam ) const
pPam->GetMark()->nNode = nNode;
pPam->GetMark()->nContent.Assign( pNode->GetCntntNode(),
nWordStart + nWordLen );
- ASSERT( nNode == pNode->GetIndex(),
+ OSL_ENSURE( nNode == pNode->GetIndex(),
"SwHyphArgs::SetPam: Pam desaster" );
}
}
@@ -2181,7 +2149,7 @@ uno::Reference< XHyphenatedWord > SwDoc::Hyphenate(
SwPaM *pPam, const Point &rCrsrPos,
sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
{
- ASSERT(this == pPam->GetDoc(), "SwDoc::Hyphenate: strangers in the night");
+ OSL_ENSURE(this == pPam->GetDoc(), "SwDoc::Hyphenate: strangers in the night");
if( *pPam->GetPoint() > *pPam->GetMark() )
pPam->Exchange();
@@ -2194,7 +2162,6 @@ uno::Reference< XHyphenatedWord > SwDoc::Hyphenate(
return aHyphArg.GetHyphWord(); // will be set by lcl_HyphenateNode
}
-
sal_Bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, sal_Bool bRegExpRplc )
{
sal_Bool bRet = sal_False;
@@ -2242,7 +2209,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
{
aPam.Move(fnMoveBackward);
}
- ASSERT((aPam.GetPoint()->nNode == aPam.GetMark()->nNode), "invalid pam?");
+ OSL_ENSURE((aPam.GetPoint()->nNode == aPam.GetMark()->nNode), "invalid pam?");
lcl_CalcBreaks(Breaks, aPam);
@@ -2268,7 +2235,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
bool bRet( true );
// iterate from end to start, to avoid invalidating the offsets!
::std::vector<xub_StrLen>::reverse_iterator iter( Breaks.rbegin() );
- ASSERT(aPam.GetPoint() == aPam.End(), "wrong!");
+ OSL_ENSURE(aPam.GetPoint() == aPam.End(), "wrong!");
SwPosition & rEnd( *aPam.End() );
SwPosition & rStart( *aPam.Start() );
@@ -2290,7 +2257,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
}
rStart = *rPam.Start(); // set to original start
- ASSERT(rEnd.nContent > rStart.nContent, "replace part empty!");
+ OSL_ENSURE(rEnd.nContent > rStart.nContent, "replace part empty!");
if (rEnd.nContent > rStart.nContent) // check if part is empty
{
bRet &= ReplaceRangeImpl(aPam, rStr, bRegExReplace);
@@ -2321,7 +2288,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
SwPosition *pStt = (SwPosition*)aDelPam.Start(),
*pEnd = (SwPosition*)aDelPam.End();
- ASSERT( pStt->nNode == pEnd->nNode ||
+ OSL_ENSURE( pStt->nNode == pEnd->nNode ||
( pStt->nNode.GetIndex() + 1 == pEnd->nNode.GetIndex() &&
!pEnd->nContent.GetIndex() ),
"invalid range: Point and Mark on different nodes" );
@@ -2532,8 +2499,8 @@ SetRedlineMode( eOld );
return true;
}
- // speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
- // in die Autokorrektur
+// speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
+// in die Autokorrektur
void SwDoc::SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew )
{
if( pACEWord && pNew != pACEWord )
@@ -2567,11 +2534,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
if( pTblNd && pNd->IsCntntNode() )
{
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
-//JP 24.08.98: will man wirklich den PageDesc/Break vom
-// nachfolgen Absatz ueberbuegeln?
-// const SwAttrSet& rAttrSet = pTableFmt->GetAttrSet();
-// if( SFX_ITEM_SET != rAttrSet.GetItemState( RES_PAGEDESC ) &&
-// SFX_ITEM_SET != rAttrSet.GetItemState( RES_BREAK ))
+
{
const SfxPoolItem *pItem;
const SfxItemSet* pSet = ((SwCntntNode*)pNd)->GetpSwAttrSet();
@@ -2638,7 +2601,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
rPam.Exchange();
if( !rPam.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_FAIL( "kein Node mehr vorhanden" );
return sal_False;
}
}
@@ -2676,7 +2639,6 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
return sal_True;
}
-
void SwDoc::TransliterateText(
const SwPaM& rPaM,
utl::TransliterationWrapper& rTrans )
@@ -2749,9 +2711,8 @@ void SwDoc::TransliterateText(
SetModified();
}
-
#define MAX_REDLINE_COUNT 250
-// -----------------------------------------------------------------------------
+
void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
{
const SwRedlineTbl& rRedlineTbl = GetRedlineTbl();
@@ -2771,7 +2732,6 @@ void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
}
}
}
-// -----------------------------------------------------------------------------
void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const
{
@@ -2837,3 +2797,5 @@ void SwDoc::RemoveLeadingWhiteSpace(const SwPosition & rPos )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 89552c3b1ad9..62cc8b4763b5 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <svl/svarray.hxx>
#endif
#include <vcl/svapp.hxx>
-#include <vcl/svapp.hxx>
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <doc.hxx>
@@ -82,7 +82,6 @@ extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
-
/*--------------------------------------------------------------------
Beschreibung: Feldtypen einfuegen
--------------------------------------------------------------------*/
@@ -91,7 +90,6 @@ SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
* Return immer einen gueltigen Pointer auf den Typ. Wenn er also neu
* zugefuegt oder schon vorhanden ist.
*/
-
SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp)
{
sal_uInt16 nSize = pFldTypes->Count(),
@@ -177,7 +175,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
sal_uInt16 nSize = pFldTypes->Count(), nFldWhich = rFldTyp.Which();
sal_uInt16 i = INIT_FLDTYPES;
- ASSERT( RES_SETEXPFLD == nFldWhich ||
+ OSL_ENSURE( RES_SETEXPFLD == nFldWhich ||
RES_USERFLD == nFldWhich ||
RES_DDEFLD == nFldWhich, "Falscher FeldTyp" );
@@ -228,10 +226,9 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
/*--------------------------------------------------------------------
Beschreibung: Feldtypen loeschen
--------------------------------------------------------------------*/
-
void SwDoc::RemoveFldType(sal_uInt16 nFld)
{
- ASSERT( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" );
+ OSL_ENSURE( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" );
/*
* Abheangige Felder vorhanden -> ErrRaise
*/
@@ -264,7 +261,7 @@ void SwDoc::RemoveFldType(sal_uInt16 nFld)
if( nWhich )
{
- ASSERT( !pTmp->GetDepends(), "Abhaengige vorh.!" );
+ OSL_ENSURE( !pTmp->GetDepends(), "Abhaengige vorh.!" );
// Feldtype loschen
delete pTmp;
}
@@ -281,7 +278,6 @@ const SwFldTypes* SwDoc::GetFldTypes() const
/*--------------------------------------------------------------------
Beschreibung: Den ersten Typen mit ResId und Namen finden
--------------------------------------------------------------------*/
-
SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
bool bDbFieldMatching // used in some UNO calls for RES_DBFLD
// to use different string matching code
@@ -329,7 +325,6 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
return pRet;
}
-
/*************************************************************************
|* SwDoc::UpdateFlds()
|* Beschreibung Felder updaten
@@ -337,7 +332,6 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
/*
* Alle sollen neu evaluiert werden.
*/
-
void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
{
// Modify() fuer jeden Feldtypen rufen,
@@ -398,7 +392,6 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
/******************************************************************************
* void SwDoc::UpdateUsrFlds()
******************************************************************************/
-
void SwDoc::UpdateUsrFlds()
{
SwCalc* pCalc = 0;
@@ -421,7 +414,6 @@ void SwDoc::UpdateUsrFlds()
/*--------------------------------------------------------------------
Beschreibung: Referenzfelder und TableFelder erneuern
--------------------------------------------------------------------*/
-
void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
{
SwFieldType* pFldType;
@@ -432,7 +424,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
- ASSERT( !pHt || RES_TABLEFML_UPDATE == pHt->Which(),
+ OSL_ENSURE( !pHt || RES_TABLEFML_UPDATE == pHt->Which(),
"Was ist das fuer ein MessageItem?" );
SwFieldType* pFldType(0);
@@ -592,11 +584,11 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
if( aPara.CalcWithStackOverflow() )
pFld->CalcField( aPara );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
// mind. ein ASSERT
- ASSERT( !this, "die Kettenformel konnte nicht errechnet werden" );
+ OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" );
}
#endif
}
@@ -661,11 +653,11 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
if( aPara.CalcWithStackOverflow() )
pFml->Calc( aPara, nValue );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
// mind. ein ASSERT
- ASSERT( !this, "die Kettenformel konnte nicht errechnet werden" );
+ OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" );
}
#endif
}
@@ -710,10 +702,6 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
SetNewFldLst(true);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
// ---- Loesche alle nicht referenzierten FeldTypen eines Dokumentes --
void SwDoc::GCFieldTypes()
{
@@ -753,12 +741,8 @@ void SwDoc::SetNewFldLst(bool bFlag)
mbNewFldLst = bFlag;
}
-
-//----------------------------------------------------------------------
-
// der StartIndex kann optional mit angegeben werden (z.B. wenn dieser
// zuvor schon mal erfragt wurde - ist sonst eine virtuelle Methode !!)
-
_SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld,
const SwIndex* pIdx )
{
@@ -785,9 +769,9 @@ _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx,
nCntnt = *rINet.GetStart();
}
- //Erweiterung fuer Sections:
- // diese haben immer als Content-Position 0xffff !!
- // Auf dieser steht nie ein Feld, maximal bis STRING_MAXLEN moeglich
+// Erweiterung fuer Sections:
+// diese haben immer als Content-Position 0xffff !!
+// Auf dieser steht nie ein Feld, maximal bis STRING_MAXLEN moeglich
_SetGetExpFld::_SetGetExpFld( const SwSectionNode& rSectNd,
const SwPosition* pPos )
{
@@ -900,8 +884,8 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm )
SwNodeIndex aIdx( *rFrm.GetNode() );
SwDoc& rDoc = *aIdx.GetNodes().GetDoc();
SwPosition aPos( aIdx );
-#ifdef DBG_UTIL
- ASSERT( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" );
#else
::GetBodyTxtNode( rDoc, aPos, rFrm );
#endif
@@ -1045,10 +1029,6 @@ void LookString( SwHash** ppTbl, sal_uInt16 nSize, const String& rName,
rRet.Erase();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld )
{
SwDBData aDBData( rDBFld.GetDBData( &rDoc ));
@@ -1067,10 +1047,6 @@ String lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld )
return sDBNumNm;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld,
SwNewDBMgr* pMgr )
{
@@ -1218,8 +1194,8 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
if( !aNew.Len() ) // nichts gefunden, dann ist
aNew = pSFld->GetFormula(); // die Formel der neue Wert
- // OD 11.02.2003 #i3141# - update expression of field as in
- // method <SwDoc::UpdateExpFlds(..)> for string/text fields
+ // #i3141# - update expression of field as in method
+ // <SwDoc::UpdateExpFlds(..)> for string/text fields
pSFld->ChgExpStr( aNew );
// suche den Namen vom Feld
@@ -1260,7 +1236,6 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
}
}
-
void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
{
if( IsExpFldsLocked() || IsInReading() )
@@ -1326,15 +1301,6 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// aktuelle Datensatznummer schon vorher einstellen
SwNewDBMgr* pMgr = GetNewDBMgr();
pMgr->CloseAll(sal_False);
-/*
- if(pMgr && pMgr->OpenDB(DBMGR_STD, GetDBDesc(), sal_False))
- {
- if(!pMgr->IsInMerge() )
- pMgr->ToFirstSelectedRecord(DBMGR_STD);
-
- aCalc.VarChange( sDBNumNm, pMgr->GetCurSelectedRecordId(DBMGR_STD));
- }
-*/
String aNew;
const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
@@ -1343,9 +1309,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwSection* pSect = (SwSection*)(*ppSortLst)->GetSection();
if( pSect )
{
- //!SECTION
-// if( pGFld->IsInBodyTxt() )
SwSbxValue aValue = aCalc.Calculate(
pSect->GetCondition() );
if(!aValue.IsVoidValue())
@@ -1356,7 +1320,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwTxtFld* pTxtFld = (SwTxtFld*)(*ppSortLst)->GetFld();
if( !pTxtFld )
{
- ASSERT( !this, "was ist es denn nun" );
+ OSL_ENSURE( !this, "was ist es denn nun" );
continue;
}
@@ -1567,10 +1531,6 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
pUpdtFlds->SetFieldsDirty( sal_False );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
{
SwNewDBMgr* pMgr = GetNewDBMgr();
@@ -1600,14 +1560,10 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
}
else
{
- DBG_ERROR("TODO: what should happen with unnamed DBFields?");
+ OSL_FAIL("TODO: what should happen with unnamed DBFields?");
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!!
{
// Feldtypen
@@ -1654,7 +1610,7 @@ void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!!
pFldTypes->Insert( new SwSetExpFieldType(this,
SW_RESSTR(STR_POOLCOLL_LABEL_DRAWING), nsSwGetSetExpType::GSE_SEQ),nFldType++);
- ASSERT( nFldType == INIT_FLDTYPES, "Bad initsize: SwFldTypes" );
+ OSL_ENSURE( nFldType == INIT_FLDTYPES, "Bad initsize: SwFldTypes" );
}
void SwDoc::InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld )
@@ -1728,6 +1684,7 @@ String lcl_DBDataToString(const SwDBData& rData)
sRet += String::CreateFromInt32(rData.nCommandType);
return sRet;
}
+
void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList,
const SvStringsDtor* pAllDBNames )
{
@@ -1804,10 +1761,6 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList,
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames )
{
SwNewDBMgr* pMgr = GetNewDBMgr();
@@ -1823,10 +1776,6 @@ void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
const String& rFormel,
SvStringsDtor& rUsedDBNames )
@@ -1861,10 +1810,6 @@ SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
return rUsedDBNames;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList,
const SvStringsDtor& rUsedDBNames )
{
@@ -1872,10 +1817,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList,
AddUsedDBToList( rDBNameList, *rUsedDBNames.GetObject(i) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName)
{
if( !rDBName.Len() )
@@ -1901,10 +1842,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName)
rDBNameList.Insert( pNew, rDBNameList.Count() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
const String& rNewName )
{
@@ -2007,10 +1944,6 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
SetModified();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
const String& rNewName, String& rFormel )
{
@@ -2052,10 +1985,6 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsNameInArray( const SvStringsDtor& rArr, const String& rName )
{
#ifdef UNX
@@ -2196,9 +2125,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen )
const SwTxtNode* pTNd = rNds[ nStt++ ]->GetTxtNode();
if( pTNd )
{
- if( //pTNd->GetFmtColl() && //#outline level,zhaojianwei
- // MAXLEVEL > pTNd->GetTxtColl()->GetOutlineLevel() )
- pTNd->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
+ if( pTNd->GetAttrOutlineLevel() != 0 )
// Kapitelfelder aktualisieren
b = sal_True;
else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() )
@@ -2222,9 +2149,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen )
GetUpdtFlds().SetFieldsDirty( b );
return bFldsFnd;
}
-/* -----------------------------21.12.99 12:55--------------------------------
- ---------------------------------------------------------------------------*/
void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
{
const sal_uInt16 nSize = pFldTypes->Count();
@@ -2241,9 +2166,6 @@ void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld )
{
@@ -2300,7 +2222,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
delete pFldSortLst;
pFldSortLst = new _SetGetExpFlds( 64, 16 );
- /// OD 09.08.2002 [#101207#,#101216#,#101778#] - consider and unhide sections
+ /// consider and unhide sections
/// with hide condition, only in mode GETFLD_ALL (<eGetMode == GETFLD_ALL>)
/// notes by OD:
/// eGetMode == GETFLD_CALC in call from methods SwDoc::FldsToCalc
@@ -2348,13 +2270,13 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
for (sal_uInt16 n = nArrStt; n < aTmpArr.Count(); ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
- ASSERT( pSectNd, "Wo ist mein SectionNode" );
+ OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" );
pSectNd->GetSection().SetCondHidden( sal_False );
}
for (sal_uInt16 n = 0; n < nArrStt; ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
- ASSERT( pSectNd, "Wo ist mein SectionNode" );
+ OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" );
pSectNd->GetSection().SetCondHidden( sal_False );
}
@@ -2400,18 +2322,6 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
break;
case RES_SETEXPFLD:
- /// OD 04.10.2002 #102894#
- /// fields of subtype <string> have also been add
- /// for calculation (eGetMode == GETFLD_CALC).
- /// Thus, add fields of subtype <string> in all modes
- /// (eGetMode == GETFLD_EXPAND||GETFLD_CALC||GETFLD_ALL)
- /// and fields of other subtypes only in the modes
- /// (eGetMode == GETFLD_CALC||GETFLD_ALL)
- /* "old" if construct - not deleted for history and code review
- if( ( nsSwGetSetExpType::GSE_STRING & pFld->GetSubType()
- ? GETFLD_EXPAND : GETFLD_CALC )
- & eGetMode )
- */
if ( !(eGetMode == GETFLD_EXPAND) ||
(nsSwGetSetExpType::GSE_STRING & pFld->GetSubType()) )
{
@@ -2492,36 +2402,8 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
}
nFldLstGetMode = static_cast<sal_uInt8>( eGetMode );
nNodes = rDoc.GetNodes().Count();
-
-#ifdef JP_DEBUG
- {
- SvFileStream sOut( "f:\\x.x", STREAM_STD_WRITE );
- sOut.Seek( STREAM_SEEK_TO_END );
- sOut << "------------------" << endl;
- const _SetGetExpFldPtr* pSortLst = pFldSortLst->GetData();
- for( sal_uInt16 n = pFldSortLst->Count(); n; --n, ++pSortLst )
- {
- String sStr( (*pSortLst)->GetNode() );
- sStr += "\t, ";
- sStr += (*pSortLst)->GetCntnt();
- sStr += "\tNode: ";
- sStr += (*pSortLst)->GetFld()->GetTxtNode().StartOfSectionIndex();
- sStr += "\tPos: ";
- sStr += *(*pSortLst)->GetFld()->GetStart();
- sStr += "\tType: ";
- sStr += (*pSortLst)->GetFld()->GetFld().GetFld()->GetTyp()->Which();
-
- sOut << sStr.GetStr() << endl;
- }
- }
-#endif
- // JP_DEBUG
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
{
const SwTxtNode& rTxtNd = rTFld.GetTxtNode();
@@ -2540,7 +2422,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
SwNodeIndex aIdx( rTxtNd );
bIsInBody = rDoc.GetNodes().GetEndOfExtras().GetIndex() < aIdx.GetIndex();
- // #104291# dvo: We don't want to update fields in redlines, or those
+ // We don't want to update fields in redlines, or those
// in frames whose anchor is in redline. However, we do want to update
// fields in hidden sections. So: In order to be updated, a field 1)
// must have a frame, or 2) it must be in the document body.
@@ -2551,8 +2433,8 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
{
// einen Index fuers bestimmen vom TextNode anlegen
SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() );
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
#else
GetBodyTxtNode( rDoc, aPos, *pFrm );
#endif
@@ -2599,8 +2481,8 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
if( !pFrm )
break;
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
#else
GetBodyTxtNode( rDoc, aPos, *pFrm );
#endif
@@ -2628,7 +2510,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType )
sFldName = ((SwSetExpFieldType&)rType).GetName();
break;
default:
- ASSERT( !this, "kein gueltiger FeldTyp" );
+ OSL_ENSURE( !this, "kein gueltiger FeldTyp" );
}
if( sFldName.Len() )
@@ -2702,12 +2584,11 @@ SwDocUpdtFld::~SwDocUpdtFld()
delete aFldTypeTable[n];
}
-// #111840#
bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
SwMsgPoolItem * pMsgHnt,
bool bUpdateFlds)
{
- ASSERT(pDstTxtFld, "no field to update!");
+ OSL_ENSURE(pDstTxtFld, "no field to update!");
sal_Bool bTblSelBreak = sal_False;
@@ -2729,10 +2610,6 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // Das gefundene Feld wird angepasst ...
- //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
- //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
-
SwField * pNewFld = rSrcFld.CopyField();
pDstFmtFld->SetFld(pNewFld);
@@ -2822,3 +2699,5 @@ bool SwDoc::PutValueToField(const SwPosition & rPos,
return pField->PutValue(rVal, nWhich);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 58af4176849a..b39f329956a5 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,6 @@
extern sal_uInt16 GetHtmlMode( const SwDocShell* );
-
using namespace ::com::sun::star;
sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
@@ -254,13 +254,13 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
//Verbindung zwischen Attribut und Format.
const SwPosition *pPos = rOldAnch.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == &rFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == &rFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -284,7 +284,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
{
const SwPosition *pPos = aNewAnch.GetCntntAnchor();
SwTxtNode *pNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "Crsr steht nicht auf TxtNode." );
+ OSL_ENSURE( pNd, "Crsr steht nicht auf TxtNode." );
SwFmtFlyCnt aFmt( static_cast<SwFlyFrmFmt*>(&rFmt) );
pNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 );
@@ -344,8 +344,8 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
pItem = 0;
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
- // OD 2004-05-14 #i28922# - correction: compare <aOldV.GetVertOrient()
- // with <text::VertOrientation::NONE>
+ // #i28922# - correction: compare <aOldV.GetVertOrient() with
+ // <text::VertOrientation::NONE>
if( text::VertOrientation::NONE == aOldV.GetVertOrient() && (!pItem ||
aOldV.GetPos() == ((SwFmtVertOrient*)pItem)->GetPos() ) )
{
@@ -401,7 +401,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
case RES_PAGEDESC:
case RES_CNTNT:
case RES_FOOTER:
- OSL_ENSURE(false, ":-) unknown Attribute for Fly.");
+ OSL_FAIL( ":-) Unbekanntes Attribut fuer Fly." );
// kein break;
case RES_CHAIN:
rSet.ClearItem( nWhich );
@@ -461,7 +461,7 @@ sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
return bRet;
}
-// --> OD 2009-07-20 #i73249#
+// #i73249#
void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
const String& sNewTitle )
{
@@ -507,7 +507,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
SetModified();
}
-// <--
sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, sal_Bool bKeepOrient )
@@ -571,9 +570,9 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
//Hori und Vert nur dann resetten, wenn in der Vorlage eine
//automatische Ausrichtung eingestellt ist, anderfalls den alten Wert
//wieder hineinstopfen.
- //JP 09.06.98: beim Update der RahmenVorlage sollte der Fly NICHT
+ // beim Update der RahmenVorlage sollte der Fly NICHT
// seine Orientierng verlieren (diese wird nicht geupdatet!)
- //OS: #96584# text::HoriOrientation::NONE and text::VertOrientation::NONE are allowed now
+ // text::HoriOrientation::NONE and text::VertOrientation::NONE are allowed now
if (!bKeepOrient)
{
rFmt.ResetFmtAttr(RES_VERT_ORIENT);
@@ -613,7 +612,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
- ASSERT( GetCurrentLayout(), "Ohne Layout geht gar nichts" ); //swmod 080218
+ OSL_ENSURE( GetCurrentLayout(), "Ohne Layout geht gar nichts" );
if ( !_rMrkList.GetMarkCount() ||
_rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -631,38 +630,36 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
{
SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
- // OD 27.06.2003 #108784# - consider, that drawing object has
+ // consider, that drawing object has
// no user call. E.g.: a 'virtual' drawing object is disconnected by
// the anchor type change of the 'master' drawing object.
// Continue with next selected object and assert, if this isn't excepted.
if ( !pContact )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bool bNoUserCallExcepted =
pObj->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawVirtObj*>(pObj)->IsConnected();
- ASSERT( bNoUserCallExcepted, "SwDoc::ChgAnchor(..) - no contact at selected drawing object" );
+ OSL_ENSURE( bNoUserCallExcepted, "SwDoc::ChgAnchor(..) - no contact at selected drawing object" );
#endif
continue;
}
- // OD 2004-03-29 #i26791#
+ // #i26791#
const SwFrm* pOldAnchorFrm = pContact->GetAnchorFrm( pObj );
const SwFrm* pNewAnchorFrm = pOldAnchorFrm;
- // --> OD 2006-03-01 #i54336#
+ // #i54336#
// Instead of only keeping the index position for an as-character
// anchored object the complete <SwPosition> is kept, because the
// anchor index position could be moved, if the object again is
// anchored as character.
-// xub_StrLen nIndx = STRING_NOTFOUND;
const SwPosition* pOldAsCharAnchorPos( 0L );
const RndStdIds eOldAnchorType = pContact->GetAnchorId();
if ( !_bSameOnly && eOldAnchorType == FLY_AS_CHAR )
{
pOldAsCharAnchorPos = new SwPosition( pContact->GetCntntAnchor() );
}
- // <--
if ( _bSameOnly )
_eAnchorType = eOldAnchorType;
@@ -682,7 +679,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
? aObjRect.TopRight()
: aPt;
- // OD 18.06.2003 #108784# - allow drawing objects in header/footer
+ // allow drawing objects in header/footer
pNewAnchorFrm = ::FindAnchor( pOldAnchorFrm, aNewPoint, false );
if ( pNewAnchorFrm->IsTxtFrm() && ((SwTxtFrm*)pNewAnchorFrm)->IsFollow() )
{
@@ -712,8 +709,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
Point aPoint( aPt );
aPoint.X() -= 1;
GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
- // OD 20.06.2003 #108784# - consider that drawing objects
- // can be in header/footer. Thus, <GetFrm()> by left-top-corner
+ // consider that drawing objects can be in
+ // header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, sal_False );
}
@@ -754,7 +751,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
else // Ankerwechsel
{
- // OD 18.06.2003 #108784# - allow drawing objects in header/footer
+ // allow drawing objects in header/footer
pNewAnchorFrm = ::FindAnchor( pOldAnchorFrm, aPt, false );
if( pNewAnchorFrm->IsProtected() )
{
@@ -785,32 +782,32 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
aNewAnch.SetAnchor( &aPos );
SetAttr( aNewAnch, *pContact->GetFmt() );
- // OD 2004-04-13 #i26791# - adjust vertical positioning to
- // 'center to baseline'
+ // #i26791# - adjust vertical positioning to 'center to
+ // baseline'
SetAttr( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ), *pContact->GetFmt() );
SwTxtNode *pNd = aPos.nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "Cursor not positioned at TxtNode." );
+ OSL_ENSURE( pNd, "Cursor not positioned at TxtNode." );
SwFmtFlyCnt aFmt( pContact->GetFmt() );
pNd->InsertItem( aFmt, aPos.nContent.GetIndex(), 0 );
}
break;
default:
- ASSERT( !this, "unexpected AnchorId." );
+ OSL_ENSURE( !this, "unexpected AnchorId." );
}
if ( (FLY_AS_CHAR != _eAnchorType) &&
pNewAnchorFrm &&
( !_bSameOnly || pNewAnchorFrm != pOldAnchorFrm ) )
{
- // OD 2004-04-06 #i26791# - Direct object positioning no longer
- // needed. Apply of attributes (method call <SetAttr(..)>) takes
- // care of the invalidation of the object position.
+ // #i26791# - Direct object positioning no longer needed. Apply
+ // of attributes (method call <SetAttr(..)>) takes care of the
+ // invalidation of the object position.
SetAttr( aNewAnch, *pContact->GetFmt() );
if ( _bPosCorr )
{
- // --> OD 2004-08-24 #i33313# - consider not connected
- // 'virtual' drawing objects
+ // #i33313# - consider not connected 'virtual' drawing
+ // objects
if ( pObj->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawVirtObj*>(pObj)->IsConnected() )
{
@@ -828,7 +825,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
}
- // --> OD 2006-03-01 #i54336#
+ // #i54336#
if ( pNewAnchorFrm && pOldAsCharAnchorPos )
{
//Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet
@@ -837,8 +834,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
//Verbindung zwischen Attribut und Format.
const xub_StrLen nIndx( pOldAsCharAnchorPos->nContent.GetIndex() );
SwTxtNode* pTxtNode( pOldAsCharAnchorPos->nNode.GetNode().GetTxtNode() );
- ASSERT( pTxtNode, "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object" );
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode, "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object" );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIndx, RES_TXTATR_FLYCNT );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -848,7 +845,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIndx, nIndx );
delete pOldAsCharAnchorPos;
}
- // <--
}
}
@@ -858,7 +854,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return bUnmark;
}
-
int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
//Die Source darf noch keinen Follow haben.
@@ -905,7 +900,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
const SwFmtAnchor& rAnchor = (*GetSpzFrmFmts())[ n ]->GetAnchor();
sal_uLong nTstSttNd;
- // OD 11.12.2003 #i20622# - to-frame anchored objects are allowed.
+ // #i20622# - to-frame anchored objects are allowed.
if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) ||
(rAnchor.GetAnchorId() == FLY_AT_CHAR)) &&
0 != rAnchor.GetCntntAnchor() &&
@@ -1017,5 +1012,4 @@ void SwDoc::Unchain( SwFrmFmt &rFmt )
}
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 67999d21381c..bc6c1e6f3e16 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,6 @@
#include <editeng/brkitem.hxx>
#include <svl/whiter.hxx>
#ifndef _ZFORLIST_HXX //autogen
-#define _ZFORLIST_DECLARE_TABLE
#include <svl/zforlist.hxx>
#endif
#include <comphelper/processfactory.hxx>
@@ -120,13 +120,11 @@ struct ParaRstFmt
const SfxItemSet* pDelSet;
sal_uInt16 nWhich;
bool bReset;
- // --> OD 2007-11-06 #i62575#
- bool bResetListAttrs;
- // <--
+ bool bResetListAttrs; // #i62575#
bool bResetAll;
bool bInclRefToxMark;
- bool bKeepOutlineLevelAttr; //#outline level,add by zhaojianwei
+ bool bKeepOutlineLevelAttr;
ParaRstFmt( const SwPosition* pStt, const SwPosition* pEnd,
SwHistory* pHst, sal_uInt16 nWhch = 0, const SfxItemSet* pSet = 0 )
@@ -136,13 +134,11 @@ struct ParaRstFmt
pEndNd(pEnd),
pDelSet(pSet),
nWhich(nWhch),
- // --> OD 2007-11-06 #i62675#
- bReset( false ),
+ bReset( false ), // #i62675#
bResetListAttrs( false ),
- // <--
bResetAll( true ),
bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
+ bKeepOutlineLevelAttr( false )
{}
ParaRstFmt( SwHistory* pHst )
@@ -152,13 +148,11 @@ struct ParaRstFmt
pEndNd(0),
pDelSet(0),
nWhich(0),
- // --> OD 2007-11-06 #i62675#
bReset( false ),
- bResetListAttrs( false ),
- // <--
+ bResetListAttrs( false ), // #i62675#
bResetAll( true ),
bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
+ bKeepOutlineLevelAttr( false )
{}
};
@@ -210,7 +204,6 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
SwDoc* pDoc = pNode->GetDoc();
- // --> OD 2008-04-14 #refactorlists#
// remove unused attribute RES_LR_SPACE
// add list attributes
SfxItemSet aSet( pDoc->GetAttrPool(),
@@ -221,11 +214,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
0 );
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
- // --> OD 2008-04-15 #refactorlists#
-// std::vector<sal_uInt16> aClearWhichIds;
SvUShorts aClearWhichIds;
- // <--
- // --> OD 2008-04-15 #refactorlists#
// restoring all paragraph list attributes
{
SfxItemSet aListAttrSet( pDoc->GetAttrPool(),
@@ -244,13 +233,10 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
}
}
}
- // <--
const SfxPoolItem* pItem;
- // sal_uInt16 __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
- // RES_PARATR_NUMRULE };
- //for( sal_uInt16 n = 0; n < 3; ++n )
- sal_uInt16 __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
+
+ sal_uInt16 const aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
RES_PARATR_NUMRULE,
RES_PARATR_OUTLINELEVEL };
for( sal_uInt16 n = 0; n < 4; ++n ) //<-end,zhaojianwei
@@ -280,24 +266,19 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( bSave )
{
aSet.Put( *pItem );
- // --> OD 2008-04-15 #refactorlists#
-// aClearWhichIds.push_back( aSavIds[n] );
aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() );
}
}
}
- // --> OD 2008-04-14 #refactorlists#
// do not clear items directly from item set and only clear to be kept
// attributes, if no deletion item set is found.
-// pNode->ClearItemsFromAttrSet( aClearWhichIds );
const bool bKeepAttributes =
!pPara || !pPara->pDelSet || pPara->pDelSet->Count() == 0;
if ( bKeepAttributes )
{
pNode->ResetAttr( aClearWhichIds );
}
- // <--
if( !bLocked )
pNode->UnlockModify();
@@ -308,16 +289,12 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( pPara->pDelSet && pPara->pDelSet->Count() )
{
- // --> OD 2008-04-15 #refactorlists#
- ASSERT( !bKeepAttributes,
+ OSL_ENSURE( !bKeepAttributes,
"<lcl_RstAttr(..)> - certain attributes are kept, but not needed. -> please inform OD" );
- // <--
SfxItemIter aIter( *pPara->pDelSet );
pItem = aIter.FirstItem();
while( sal_True )
{
- // --> OD 2008-04-14 #refactorlists#
- //
if ( ( pItem->Which() != RES_PAGEDESC &&
pItem->Which() != RES_BREAK &&
pItem->Which() != RES_PARATR_NUMRULE ) ||
@@ -325,7 +302,6 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
{
pNode->ResetAttr( pItem->Which() );
}
- // <--
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
@@ -339,10 +315,8 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
else
pNode->ResetAllAttr();
- // --> OD 2008-04-15 #refactorlists#
// only restore saved attributes, if needed
if ( bKeepAttributes && aSet.Count() )
- // <--
{
pNode->LockModify();
@@ -376,9 +350,7 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark )
void SwDoc::ResetAttrs( const SwPaM &rRg,
sal_Bool bTxtAttr,
const SvUShortsSort* pAttrs,
- // --> OD 2008-11-28 #b96644#
const bool bSendDataChangedEvents )
- // <--
{
SwPaM* pPam = (SwPaM*)&rRg;
if( !bTxtAttr && pAttrs && pAttrs->Count() &&
@@ -433,14 +405,13 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pPam->GetPoint()->nContent = nPtPos;
}
- // --> OD 2008-11-28 #i96644#
+ // #i96644#
// SwDataChanged aTmp( *pPam, 0 );
std::auto_ptr< SwDataChanged > pDataChanged;
if ( bSendDataChangedEvents )
{
pDataChanged.reset( new SwDataChanged( *pPam, 0 ) );
}
- // <--
SwHistory* pHst = 0;
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -458,13 +429,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
ParaRstFmt aPara( pStt, pEnd, pHst );
// mst: not including META here; it seems attrs with CH_TXTATR are omitted
- sal_uInt16 __FAR_DATA aResetableSetRange[] = {
+ sal_uInt16 aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
@@ -628,9 +597,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
}
if ( isPARATR(nWhich)
- // --> OD 2008-02-25 #refactorlists#
|| isPARATR_LIST(nWhich)
- // <--
|| isFRMATR(nWhich)
|| isGRFATR(nWhich)
|| isUNKNOWNATR(nWhich) )
@@ -655,9 +622,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -679,21 +644,19 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if( pNode && pNode->IsTxtNode() )
{
- // -> #i27615#
+ // #i27615#
if (rRg.IsInFrontOfLabel())
{
SwTxtNode * pTxtNd = pNode->GetTxtNode();
SwNumRule * pNumRule = pTxtNd->GetNumRule();
- // --> OD 2005-10-24 #126346# - make code robust:
+ // make code robust:
if ( !pNumRule )
{
- ASSERT( false,
- "<InsAttr(..)> - PaM in front of label, but text node has no numbering rule set. This is a serious defect, please inform OD." );
+ OSL_FAIL( "<InsAttr(..)> - PaM in front of label, but text node has no numbering rule set. This is a serious defect, please inform OD." );
DELETECHARSETS
return false;
}
- // <--
SwNumFmt aNumFmt = pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()));
SwCharFmt * pCharFmt =
@@ -711,7 +674,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
DELETECHARSETS
return true;
}
- // <- #i27615#
const SwIndex& rSt = pStt->nContent;
@@ -1203,7 +1165,6 @@ void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
SetModified();
}
-// --> OD 2008-02-12 #newlistlevelattrs#
void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
SwFmt& rChangedFormat )
{
@@ -1225,7 +1186,6 @@ void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
else if ( pUndo )
delete pUndo;
}
-// <--
int lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
SvxTabStopItem& rChgTabStop )
@@ -1290,9 +1250,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
bCheckSdrDflt = 0 != pSdrPool;
}
else if ( isPARATR(nWhich) ||
- // --> OD 2008-02-25 #refactorlists#
isPARATR_LIST(nWhich) )
- // <--
{
aCallMod.Add( pDfltTxtFmtColl );
bCheckSdrDflt = 0 != pSdrPool;
@@ -1420,7 +1378,7 @@ void SwDoc::DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast)
void SwDoc::DelCharFmt( SwCharFmt *pFmt, sal_Bool bBroadcast )
{
sal_uInt16 nFmt = pCharFmtTbl->GetPos( pFmt );
- ASSERT( USHRT_MAX != nFmt, "Fmt not found," );
+ OSL_ENSURE( USHRT_MAX != nFmt, "Fmt not found," );
DelCharFmt( nFmt, bBroadcast );
}
@@ -1429,7 +1387,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
{
if( pFmt->ISA( SwTableBoxFmt ) || pFmt->ISA( SwTableLineFmt ))
{
- ASSERT( !this, "Format steht nicht mehr im DocArray, "
+ OSL_ENSURE( !this, "Format steht nicht mehr im DocArray, "
"kann per delete geloescht werden" );
delete pFmt;
}
@@ -1458,7 +1416,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
else
{
nPos = GetSpzFrmFmts()->GetPos( pFmt );
- ASSERT( nPos != USHRT_MAX, "FrmFmt not found." );
+ OSL_ENSURE( nPos != USHRT_MAX, "FrmFmt not found." );
if( USHRT_MAX != nPos )
GetSpzFrmFmts()->DeleteAndDestroy( nPos );
}
@@ -1468,7 +1426,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
void SwDoc::DelTblFrmFmt( SwTableFmt *pFmt )
{
sal_uInt16 nPos = pTblFrmFmtTbl->GetPos( pFmt );
- ASSERT( USHRT_MAX != nPos, "Fmt not found," );
+ OSL_ENSURE( USHRT_MAX != nPos, "Fmt not found," );
pTblFrmFmtTbl->DeleteAndDestroy( nPos );
}
@@ -1576,12 +1534,11 @@ SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName,
}
-// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
+// #i40550# - add parameter <bAuto> - not relevant
SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName,
SwCharFmt *pDerivedFrom,
sal_Bool bBroadcast,
sal_Bool )
-// <--
{
SwCharFmt *pFmt = new SwCharFmt( GetAttrPool(), rFmtName, pDerivedFrom );
pCharFmtTbl->Insert( pFmt, pCharFmtTbl->Count() );
@@ -1618,12 +1575,11 @@ SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName,
* Erzeugen der FormatCollections
*/
// TXT
-// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
+// #i40550# - add parameter <bAuto> - not relevant
SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName,
SwTxtFmtColl *pDerivedFrom,
sal_Bool bBroadcast,
sal_Bool )
-// <--
{
SwTxtFmtColl *pFmtColl = new SwTxtFmtColl( GetAttrPool(), rFmtName,
pDerivedFrom );
@@ -1689,7 +1645,7 @@ SwGrfFmtColl* SwDoc::MakeGrfFmtColl( const String &rFmtName,
void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast)
{
- ASSERT( nFmtColl, "Remove fuer Coll 0." );
+ OSL_ENSURE( nFmtColl, "Remove fuer Coll 0." );
// Wer hat die zu loeschende als Next
SwTxtFmtColl *pDel = (*pTxtFmtCollTbl)[nFmtColl];
@@ -1720,7 +1676,7 @@ void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast)
void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, sal_Bool bBroadcast )
{
sal_uInt16 nFmt = pTxtFmtCollTbl->GetPos( pColl );
- ASSERT( USHRT_MAX != nFmt, "Collection not found," );
+ OSL_ENSURE( USHRT_MAX != nFmt, "Collection not found," );
DelTxtFmtColl( nFmt, bBroadcast );
}
@@ -1741,18 +1697,15 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
lcl_RstAttr( pCNd, pPara );
- // --> OD 2007-11-06 #i62675#
- // --> OD 2008-04-15 #refactorlists#
- // check, if paragraph style has changed
+ // #i62675# check, if paragraph style has changed
if ( pPara->bResetListAttrs &&
pFmt != pCNd->GetFmtColl() &&
pFmt->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET )
{
- // --> OD 2009-09-07 #b6876367#
// Check, if the list style of the paragraph will change.
bool bChangeOfListStyleAtParagraph( true );
SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
- ASSERT( pTNd,
+ OSL_ENSURE( pTNd,
"<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
{
SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() );
@@ -1770,7 +1723,6 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
if ( bChangeOfListStyleAtParagraph )
{
- // --> OD 2008-04-08 #refactorlists#
std::auto_ptr< SwRegHistory > pRegH;
if ( pPara->pHistory )
{
@@ -1786,9 +1738,7 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
pCNd->ResetAttr( RES_PARATR_LIST_ID );
}
- // <--
}
- // <--
}
// erst in die History aufnehmen, damit ggfs. alte Daten
@@ -1816,11 +1766,9 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl* pUndo = new SwUndoFmtColl( rRg, pFmt,
bReset,
bResetListAttrs );
- // <--
pHst = pUndo->GetHistory();
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
@@ -1828,9 +1776,8 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
ParaRstFmt aPara( pStt, pEnd, pHst );
aPara.pFmtColl = pFmt;
aPara.bReset = bReset;
- // --> OD 2007-11-06 #i62675#
+ // #i62675#
aPara.bResetListAttrs = bResetListAttrs;
- // <--
GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
lcl_SetTxtFmtColl, &aPara );
@@ -1866,9 +1813,8 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
fnCopyFmt, rDfltFmt );
// erzeuge das Format und kopiere die Attribute
- // --> OD 2005-01-13 #i40550#
+ // #i40550#
SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, sal_False, sal_True );
- // <--
pNewFmt->SetAuto( rFmt.IsAuto() );
pNewFmt->CopyAttrs( rFmt, sal_True ); // kopiere Attribute
@@ -1933,9 +1879,6 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
// kopiere jetzt noch die Auto-Formate oder kopiere die Attribute
pNewColl->CopyAttrs( rColl, sal_True );
- // setze noch den Outline-Level
- //if( NO_NUMBERING != rColl.GetOutlineLevel() ) //#outline level,zhaojianwei
- // pNewColl->SetOutlineLevel( rColl.GetOutlineLevel() );
if(rColl.IsAssignedToListLevelOfOutlineStyle())
pNewColl->AssignToListLevelOfOutlineStyle(rColl.GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
//<-end
@@ -2031,9 +1974,8 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
if( RES_CONDTXTFMTCOLL == pSrc->Which() )
MakeCondTxtFmtColl( pSrc->GetName(), (SwTxtFmtColl*)&rDfltFmt );
else
- // --> OD 2005-01-13 #i40550#
+ // #i40550#
(this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, sal_False, sal_True );
- // <--
}
}
@@ -2090,9 +2032,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDstColl->SetNextTxtFmtColl( *(SwTxtFmtColl*)FindFmtByName(
rDestArr, pSrcColl->GetNextTxtFmtColl().GetName() ) );
- // setze noch den Outline-Level
- //if( NO_NUMBERING != pSrcColl->GetOutlineLevel() ) //#outline level,zhaojianwei
- // pDstColl->SetOutlineLevel( pSrcColl->GetOutlineLevel() );
if(pSrcColl->IsAssignedToListLevelOfOutlineStyle())
pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
//<-end
@@ -2356,7 +2295,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulu
{
SvxLRSpaceItem aLS( (SvxLRSpaceItem&)pTNd->SwCntntNode::GetAttr( RES_LR_SPACE ) );
- // --> FME 2008-09-16 #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
+ // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
if ( pTNd->AreListLevelIndentsApplicable() )
{
const SwNumRule* pRule = pTNd->GetNumRule();
@@ -2429,13 +2368,11 @@ void SwDoc::_CreateNumberFormatter()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::_CreateNumberFormatter" );
- ASSERT( !pNumberFormatter, "ist doch schon vorhanden" );
+ OSL_ENSURE( !pNumberFormatter, "ist doch schon vorhanden" );
+
+ LanguageType eLang = LANGUAGE_SYSTEM;
- LanguageType eLang = LANGUAGE_SYSTEM; //System::GetLanguage();
-/* ((const SvxLanguageItem&)GetAttrPool().
- GetDefaultItem( RES_CHRATR_LANGUAGE )).GetLanguage();
-*/
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
pNumberFormatter = new SvNumberFormatter( xMSF, eLang );
pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
@@ -2524,19 +2461,6 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
// in den Node gesetzt werden. Also muss man die Differenz nehmen
SwRedlineExtraData_Format aExtraData( rSet );
-/*
- if( pSet && pTNd->HasSwAttrSet() )
- {
- SfxItemSet aTmp( *pTNd->GetpSwAttrSet() );
- aTmp.Differentiate( *pSet );
- // das Adjust Item behalten wir extra
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pTNd->GetpSwAttrSet()->GetItemState(
- RES_PARATR_ADJUST, sal_False, &pItem ))
- aTmp.Put( *pItem );
- aExtraData.SetItemSet( aTmp );
- }
-*/
pRedl->SetExtraData( &aExtraData );
// !!!!!!!!! Undo fehlt noch !!!!!!!!!!!!!!!!!!
@@ -2625,7 +2549,7 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
BroadcastStyleOperation(sNewName, eFamily, SFX_STYLESHEET_MODIFIED);
}
-// --> OD 2006-09-27 #i69627#
+// #i69627#
namespace docfunc
{
bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc )
@@ -2646,7 +2570,6 @@ namespace docfunc
SwTxtFmtColl* pTxtFmtColl = (*pTxtFmtColls)[i];
if ( pTxtFmtColl->IsDefault() ||
- // pTxtFmtColl->GetOutlineLevel() == NO_NUMBERING ) //#outline level,zhaojianwei
! pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() ) //<-end,zhaojianwei
{
continue;
@@ -2659,15 +2582,13 @@ namespace docfunc
if ( SFX_ITEM_SET == pParentTxtFmtColl->GetItemState( RES_PARATR_NUMRULE ) )
{
- // --> OD 2009-11-12 #i106218#
- // consider that the outline style is set
+ // #i106218# consider that the outline style is set
const SwNumRuleItem& rDirectItem = pParentTxtFmtColl->GetNumRule();
if ( rDirectItem.GetValue() != rDoc.GetOutlineNumRule()->GetName() )
{
bRet = true;
break;
}
- // <--
}
}
@@ -2675,4 +2596,5 @@ namespace docfunc
return bRet;
}
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index e268f283df2b..8d7c8523aa46 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -329,8 +330,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
pFtnInfo->ModifyNotification( &aOld, &aNew );
}
- // --> OD 2008-01-09 #i81002#
- // no update during loading
+ // #i81002# no update during loading
if ( !IsInReading() )
{
UpdateRefFlds(NULL);
@@ -399,8 +399,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
pEndNoteInfo->ModifyNotification( &aOld, &aNew );
}
- // --> OD 2008-01-09 #i81002#
- // no update during loading
+ // #i81002# no update during loading
if ( !IsInReading() )
{
UpdateRefFlds(NULL);
@@ -445,8 +444,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
nSttCnt <= *pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
- if( /*rFtn.GetNumber() != nNumber ||*/
- rFtn.GetNumStr() != rNumStr ||
+ if( rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
bChg = sal_True;
@@ -477,8 +475,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
nEndCnt >= *pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
- if( /*rFtn.GetNumber() != nNumber ||*/
- rFtn.GetNumStr() != rNumStr ||
+ if( rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
bChg = sal_True;
@@ -529,3 +526,4 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 26d9c75e2140..b72e5ded4689 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,24 +88,6 @@ sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
-#ifdef JP_TEST
- if( !pSplitColl )
- {
- sal_uInt8 nLvl = 1;
- const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
- for( sal_uInt16 n = rFmtColls.Count(); n; )
- //if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
- if( nLvl == rFmtColls[ --n ]->GetAttrOutlineLevel() -1 )//<-end,zhaojianwei 0814
- {
- pSplitColl = rFmtColls[ n ];
- break;
- }
-
- if( !pSplitColl )
- pSplitColl = GetTxtCollFromPool( RES_POOLCOLL_HEADLINE2 );
- }
-#endif
-
return SplitDoc( SPLITDOC_TO_HTML, rPath, pSplitColl );
}
@@ -129,7 +112,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
{
// wenn keine OutlineNumerierung ist, dann benutze eigenes Array
// und sammel die Nodes zusammen.
- //if( NO_NUMBERING == pSplitColl->GetOutlineLevel() )//#outline level,zhaojianwei
if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
{
pOutlNds = new SwOutlineNodes( 8, 8 );
@@ -150,7 +132,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// dann suche die Gliederungs - Vorlage, der 1. Ebene
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
for( sal_uInt16 n = rFmtColls.Count(); n; )
- //if( !rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
pSplitColl = rFmtColls[ n ];
@@ -170,7 +151,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
break;
default:
-// case SPLITDOC_TO_GLOBALDOC:
pFilter = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii( FILTER_XML ));
eDocType = SPLITDOC_TO_GLOBALDOC;
@@ -230,11 +210,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
pNd = pOutlNds->GetObject( nOutl );
SwTxtFmtColl* pTColl = pNd->GetTxtNode()->GetTxtColl();
- //if( ( pTColl == pSplitColl || //#outline level,zhaojianwei
- // ( NO_NUMBERING != pSplitColl->GetOutlineLevel() &&
- // pTColl->GetOutlineLevel() <
- // pSplitColl->GetOutlineLevel() )) &&
- // !pNd->FindTableNode() )
if( ( pTColl == pSplitColl ||
( pSplitColl->GetAttrOutlineLevel() > 0 &&
pTColl->GetAttrOutlineLevel() > 0 &&
@@ -357,7 +332,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_FAIL( "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
@@ -475,7 +450,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
} while( pSttNd );
-// if( pOutlNds != (SwOutlineNodes*)&GetNodes().GetOutLineNds();
if( pOutlNds != &GetNodes().GetOutLineNds() )
delete pOutlNds;
@@ -493,7 +467,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
break;
-// case SPLITDOC_TO_GLOBALDOC:
default:
// dann das Globaldoc speichern
set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
@@ -531,7 +504,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
break;
default:
-// case SPLITDOC_TO_GLOBALDOC:
pFilter = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii( FILTER_XML ));
eDocType = SPLITDOC_TO_GLOBALDOC;
@@ -669,7 +641,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
if( SPLITDOC_TO_HTML == eDocType &&
pDoc->GetSpzFrmFmts()->Count() )
{
- /* SfxViewFrame* pFrame = */
SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
}
xDocSh->DoSaveAs( *pTmpMed );
@@ -708,7 +679,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_FAIL( "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
@@ -853,3 +824,4 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
return pRet && pRet->GetValue();
}//<-end,zhaojianwei
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 610a8fb170b8..350bde67062c 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@ static void lcl_copyDocumentProperties(
}
}
-/* -----------------22.07.99 11:47-------------------
+/* --------------------------------------------------
Description: inserts an AutoText block
--------------------------------------------------*/
sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
@@ -115,8 +116,6 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
sal_uInt16 nIdx = rBlock.GetIndex( rEntry );
if( (sal_uInt16) -1 != nIdx )
{
- // Bug #70238# ask the TextOnly-Flag before BeginGetDoc, because
- // the method closed the Storage!
sal_Bool bSav_IsInsGlossary = mbInsOnlyTxtGlssry;
mbInsOnlyTxtGlssry = rBlock.IsOnlyTextBlock( nIdx );
@@ -201,3 +200,4 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 1d7531e5504d..46dfe7ec0e2c 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,6 @@
#include <rtl/logfile.hxx>
#include <SwStyleNameMapper.hxx>
#include <fchrfmt.hxx>
-#include <errhdl.hxx>
#include <frmatr.hxx>
#include <txatbase.hxx>
#include <fmtfld.hxx>
@@ -67,7 +67,6 @@
#include <fmtflcnt.hxx>
#include <fmtcnct.hxx>
#include <frmfmt.hxx>
-#include <dcontact.hxx>
#include <txtflcnt.hxx>
#include <docfld.hxx> // fuer Expression-Felder
#include <pam.hxx>
@@ -101,21 +100,18 @@
#include <PostItMgr.hxx>
#include <comcore.hrc> // STR-ResId's
-// #i11176#
#include <unoframe.hxx>
-// OD 2004-05-24 #i28701#
+
#include <sortedobjs.hxx>
-// --> OD 2004-07-26 #i32089#
#include <vector>
-// <--
using namespace ::com::sun::star;
using ::rtl::OUString;
#define DEF_FLY_WIDTH 2268 //Defaultbreite fuer FlyFrms (2268 == 4cm)
-/* #109161# */
+
static bool lcl_IsItemSet(const SwCntntNode & rNode, sal_uInt16 which)
{
bool bResult = false;
@@ -135,11 +131,7 @@ static bool lcl_IsItemSet(const SwCntntNode & rNode, sal_uInt16 which)
|* entsprechende Formate-Array gestellt.
|* Wenn bereits ein passendes Format existiert, so wird dies
|* zurueckgeliefert.
-|* Ersterstellung MA 22. Sep. 92
-|* Letzte Aenderung JP 08.05.98
-|*
|*************************************************************************/
-
SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
{
SwFrmFmt *pFmt = 0;
@@ -206,34 +198,32 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
case FLY_AT_PAGE:
case FLY_AT_CHAR:
case FLY_AT_FLY:
case FLY_AT_PARA:
case FLY_AS_CHAR:
- ASSERT( false, "use new interface instead: SwDoc::MakeFlySection!" );
+ OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" );
break;
#endif
default:
- ASSERT( !this,
+ OSL_ENSURE( !this,
"Layoutformat mit ungueltigem Request angefordert." );
}
return pFmt;
}
+
/*************************************************************************
|*
|* SwDoc::DelLayoutFmt()
|*
|* Beschreibung Loescht das angegebene Format, der Inhalt wird mit
|* geloescht.
-|* Ersterstellung MA 23. Sep. 92
-|* Letzte Aenderung MA 05. Feb. 93
|*
|*************************************************************************/
-
void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
{
//Verkettung von Rahmen muss ggf. zusammengefuehrt werden.
@@ -260,18 +250,6 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
SwOLENode* pOLENd = GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
{
- /*
- SwDoc* pDoc = (SwDoc*)pFmt->GetDoc();
- if( pDoc )
- {
- SfxObjectShell* p = pDoc->GetPersist();
- if( p ) // muss da sein
- {
- SvInfoObjectRef aRef( p->Find( pOLENd->GetOLEObj().GetName() ) );
- if( aRef.Is() )
- aRef->SetObj(0);
- }
- } */
// TODO/MBA: the old object closed the object, cleared all references to it, but didn't remove it from the container.
// I have no idea, why, nobody could explain it - so I do my very best to mimic this behavior
@@ -287,7 +265,6 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
}
- //pOLENd->GetOLEObj().GetOleRef() = 0;
}
}
@@ -303,7 +280,7 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
else
{
- // --> OD 2004-07-26 #i32089# - delete at-frame anchored objects
+ // #i32089# - delete at-frame anchored objects
if ( nWh == RES_FLYFRMFMT )
{
// determine frame formats of at-frame anchored objects
@@ -388,22 +365,18 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
|* Vom chaos::Anchor-Attribut wird die Position immer
|* auf 0 gesetzt !!!
|*
-|* Ersterstellung BP 18.12.92
-|* Letzte Aenderung MA 17. Jul. 96
-|*
|*************************************************************************/
-
SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
const SwFmtAnchor& rNewAnchor,
bool bSetTxtFlyAtt, bool bMakeFrms )
{
const bool bFly = RES_FLYFRMFMT == rSource.Which();
const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
- ASSERT( bFly || bDraw, "this method only works for fly or draw" );
+ OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
SwDoc* pSrcDoc = (SwDoc*)rSource.GetDoc();
- // #108784# may we copy this object?
+ // May we copy this object?
// We may, unless it's 1) it's a control (and therfore a draw)
// 2) anchored in a header/footer
// 3) anchored (to paragraph?)
@@ -505,16 +478,16 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
}
else
{
- ASSERT( RES_DRAWFRMFMT == rSource.Which(), "Weder Fly noch Draw." );
- // OD 2005-08-02 #i52780# - Note: moving object to visible layer not needed.
+ OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Weder Fly noch Draw." );
+ // #i52780# - Note: moving object to visible layer not needed.
SwDrawContact* pSourceContact = (SwDrawContact *)rSource.FindContactObj();
SwDrawContact* pContact = new SwDrawContact( (SwDrawFrmFmt*)pDest,
CloneSdrObj( *pSourceContact->GetMaster(),
mbCopyIsMove && this == pSrcDoc ) );
- // --> OD 2005-05-23 #i49730# - notify draw frame format
- // that position attributes are already set, if the position attributes
- // are already set at the source draw frame format.
+ // #i49730# - notify draw frame format that position attributes are
+ // already set, if the position attributes are already set at the
+ // source draw frame format.
if ( pDest->ISA(SwDrawFrmFmt) &&
rSource.ISA(SwDrawFrmFmt) &&
static_cast<const SwDrawFrmFmt&>(rSource).IsPosAttrSet() )
@@ -525,8 +498,7 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
if( pDest->GetAnchor() == rNewAnchor )
{
- // OD 03.07.2003 #108784# - do *not* connect to layout, if
- // a <MakeFrms> will not be called.
+ // Do *not* connect to layout, if a <MakeFrms> will not be called.
if ( bMakeFrms )
{
pContact->ConnectToLayout( &rNewAnchor );
@@ -558,9 +530,8 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
sal_Bool bInsInPage )
{
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
SdrPage *pPg = GetOrCreateDrawModel()->GetPage( 0 );
- // <--
if( !pPg )
{
pPg = GetDrawModel()->AllocPage( sal_False );
@@ -574,7 +545,7 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
uno::Reference< awt::XControlModel > xModel = ((SdrUnoObj*)pObj)->GetUnoControlModel();
uno::Any aVal;
uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
- OUString sName( rtl::OUString::createFromAscii("Name") );
+ OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
if( xSet.is() )
aVal = xSet->getPropertyValue( sName );
if( bInsInPage )
@@ -585,8 +556,7 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
else if( bInsInPage )
pPg->InsertObject( pObj );
- // OD 02.07.2003 #108784# - for drawing objects: set layer of cloned object
- // to invisible layer
+ // For drawing objects: set layer of cloned object to invisible layer
SdrLayerID nLayerIdForClone = rObj.GetLayer();
if ( !pObj->ISA(SwFlyDrawObj) &&
!pObj->ISA(SwVirtFlyDrawObj) &&
@@ -649,8 +619,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
// Anker noch nicht gesetzt ?
RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId()
: pFmt->GetAnchor().GetAnchorId();
- // --> OD 2010-01-07 #i107811#
- // Assure that at-page anchored fly frames have a page num or a content anchor set.
+ // #i107811# Assure that at-page anchored fly frames have a page num or a
+ // content anchor set.
if ( !pAnchor ||
( FLY_AT_PAGE != pAnchor->GetAnchorId() &&
!pAnchor->GetCntntAnchor() ) ||
@@ -694,7 +664,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
xub_StrLen nStt = rAnchPos.nContent.GetIndex();
SwTxtNode * pTxtNode = rAnchPos.nNode.GetNode().GetTxtNode();
- ASSERT(pTxtNode!= 0, "There should be a SwTxtNode!");
+ OSL_ENSURE(pTxtNode!= 0, "There should be a SwTxtNode!");
if (pTxtNode != NULL)
{
@@ -773,7 +743,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
sal_uInt16 nCollId = static_cast<sal_uInt16>(
get(IDocumentSettingAccess::HTML_MODE) ? RES_POOLCOLL_TEXT : RES_POOLCOLL_FRAME );
- /* #109161# If there exists no adjust item in the paragraph
+ /* If there exists no adjust item in the paragraph
style for the content node of the new fly section
propagate an existing adjust item at the anchor to the new
content node. */
@@ -814,7 +784,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
{
do { // middle check loop
const SwFmtCntnt &rCntnt = pFmt->GetCntnt();
- ASSERT( rCntnt.GetCntntIdx(), "Kein Inhalt vorbereitet." );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "Kein Inhalt vorbereitet." );
SwNodeIndex aIndex( *(rCntnt.GetCntntIdx()), 1 );
SwCntntNode *pNode = aIndex.GetNode().GetCntntNode();
@@ -863,7 +833,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
// wenn Tabelle im Rahmen, dann ohne nachfolgenden TextNode
aIndex = rCntnt.GetCntntIdx()->GetNode().EndOfSectionIndex() - 1;
- ASSERT( aIndex.GetNode().GetTxtNode(),
+ OSL_ENSURE( aIndex.GetNode().GetTxtNode(),
"hier sollte ein TextNode stehen" );
aPos.nContent.Assign( 0, 0 ); // Index abmelden !!
GetNodes().Delete( aIndex, 1 );
@@ -878,15 +848,6 @@ if( GetIDocumentUndoRedo().DoesUndo() )
}
else
{
-/*
- // alle Pams verschieben
- SwPaM* pTmp = (SwPaM*)&rPam;
- do {
- if( pTmp->HasMark() &&
- *pTmp->GetPoint() != *pTmp->GetMark() )
- MoveAndJoin( *pTmp, aPos );
- } while( &rPam != ( pTmp = (SwPaM*)pTmp->GetNext() ) );
-*/
// copy all Pams and then delete all
SwPaM* pTmp = (SwPaM*)&rPam;
sal_Bool bOldFlag = mbCopyIsMove;
@@ -924,9 +885,8 @@ if( GetIDocumentUndoRedo().DoesUndo() )
return pFmt;
}
-
- //Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
- // angemeldet sein.
+// Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
+// angemeldet sein.
SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
SdrObject& rDrawObj,
const SfxItemSet* pFlyAttrSet,
@@ -962,8 +922,8 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
: &rRg.GetPoint()->nNode;
}
- // OD 24.06.2003 #108784# - allow drawing objects in header/footer, but
- // control objects aren't allowed in header/footer.
+ // Allow drawing objects in header/footer, but control objects aren't
+ // allowed in header/footer.
if( pChkIdx &&
::CheckControlLayer( &rDrawObj ) &&
IsInHeaderFooter( *pChkIdx ) )
@@ -1008,14 +968,13 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
if( GetCurrentViewShell() )
{
pFmt->MakeFrms();
- // --> OD 2005-02-09 #i42319# - follow-up of #i35635#
+ // #i42319# - follow-up of #i35635#
// move object to visible layer
- // --> OD 2007-07-10 #i79391#
+ // #i79391#
if ( pContact->GetAnchorFrm() )
{
pContact->MoveObjToVisibleLayer( &rDrawObj );
}
- // <--
}
if (GetIDocumentUndoRedo().DoesUndo())
@@ -1027,27 +986,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
return pFmt;
}
-/*************************************************************************
-|*
-|* SwDoc::GetAllFlyFmts
-|*
-|* Ersterstellung MA 14. Jul. 93
-|* Letzte Aenderung MD 23. Feb. 95
-|*
-|*************************************************************************/
-
-/*sal_Bool TstFlyRange( const SwPaM* pPam, sal_uInt32 nFlyPos )
-{
- sal_Bool bOk = sal_False;
- const SwPaM* pTmp = pPam;
- do {
- bOk = pTmp->Start()->nNode.GetIndex() < nFlyPos &&
- pTmp->End()->nNode.GetIndex() > nFlyPos;
- } while( !bOk && pPam != ( pTmp = (const SwPaM*)pTmp->GetNext() ));
- return bOk;
-}
-*/
-/* -----------------------------04.04.00 10:55--------------------------------
+/* ---------------------------------------------------------------------------
paragraph frames - o.k. if the PaM includes the paragraph from the beginning
to the beginning of the next paragraph at least
frames at character - o.k. if the pam start at least at the same position
@@ -1087,7 +1026,6 @@ sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos,
return bOk;
}
-
void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
const SwPaM* pCmpRange, sal_Bool bDrawAlso ) const
{
@@ -1179,9 +1117,6 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
|*
|* SwDoc::InsertLabel()
|*
-|* Ersterstellung MA 11. Feb. 94
-|* Letzte Aenderung MA 12. Nov. 97
-|*
|*************************************************************************/
/* #i6447# changed behaviour if lcl_CpyAttr:
@@ -1195,7 +1130,6 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
Otherwise the new set will not be changed.
*/
-
void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWhich )
{
const SfxPoolItem *pOldItem = NULL, *pNewItem = NULL;
@@ -1215,17 +1149,16 @@ void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWh
rNewSet.Put( *pOldItem );
}
else {
- ASSERT(0, "What am I doing here?");
+ OSL_FAIL("What am I doing here?");
}
}
else {
- ASSERT(0, "What am I doing here?");
+ OSL_FAIL("What am I doing here?");
}
}
}
-
static SwFlyFrmFmt *
lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
SwUndoInsertLabel *const pUndo,
@@ -1278,7 +1211,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//einfuegen (Frame wird automatisch erzeugt).
{
SwStartNode *pSttNd = rDoc.GetNodes()[nNdIdx]->GetStartNode();
- ASSERT( pSttNd, "Kein StartNode in InsertLabel." );
+ OSL_ENSURE( pSttNd, "Kein StartNode in InsertLabel." );
sal_uLong nNode;
if( bBefore )
{
@@ -1311,7 +1244,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
- ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
+ OSL_ENSURE( pOldFmt, "Format des Fly nicht gefunden." );
// --> OD #i115719#
// <title> and <description> attributes are lost when calling <DelFrms()>.
// Thus, keep them and restore them after the calling <MakeFrms()>
@@ -1401,14 +1334,14 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
{
const SwPosition *pPos = rAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(nIdx, RES_TXTATR_FLYCNT);
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pOldFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pOldFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt(
@@ -1473,7 +1406,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
default:
OSL_ENSURE(false, "unknown LabelType?");
}
- ASSERT( pNew, "No Label inserted" );
+ OSL_ENSURE( pNew, "No Label inserted" );
if( pNew )
{
//#i61007# order of captions
@@ -1589,11 +1522,7 @@ SwDoc::InsertLabel(
|*
|* SwDoc::InsertDrawLabel()
|*
-|* Ersterstellung MIB 7. Dez. 98
-|* Letzte Aenderung MIB 7. Dez. 98
-|*
|*************************************************************************/
-
static SwFlyFrmFmt *
lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
SwUndoInsertLabel *const pUndo, SwDrawFrmFmt *const pOldFmt,
@@ -1641,7 +1570,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
// dem Object (Grafik/Ole) absatzgebunden in den neuen Rahmen,
// Frames erzeugen.
- // OD 27.11.2003 #112045# - Keep layer ID of drawing object before removing
+ // Keep layer ID of drawing object before removing
// its frames.
// Note: The layer ID is passed to the undo and have to be the correct value.
// Removing the frames of the drawing object changes its layer.
@@ -1669,7 +1598,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_SURROUND );
// Den Rahmen ggf. in den Hintergrund schicken.
- // OD 02.07.2003 #108784# - consider 'invisible' hell layer.
+ // Consider 'invisible' hell layer.
if ( rDoc.GetHellId() != nLayerId &&
rDoc.GetInvisibleHellId() != nLayerId )
{
@@ -1679,7 +1608,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
}
// Position uebernehmen
- // OD 2004-04-15 #i26791# - use directly the positioning attributes of
+ // #i26791# - use directly the positioning attributes of
// the drawing object.
pNewSet->Put( pOldFmt->GetHoriOrient() );
pNewSet->Put( pOldFmt->GetVertOrient() );
@@ -1723,15 +1652,15 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
{
const SwPosition *pPos = rAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
-#ifdef DBG_UTIL
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).
+ OSL_ENSURE( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).
GetFrmFmt() == (SwFrmFmt*)pOldFmt,
"Wrong TxtFlyCnt-Hint." );
#endif
@@ -1746,9 +1675,9 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
if (nLayerId == rDoc.GetHellId())
{
+ // Consider drawing objects in 'invisible' hell layer
rSdrObj.SetLayer( rDoc.GetHeavenId() );
}
- // OD 02.07.2003 #108784# - consider drawing objects in 'invisible' hell layer
else if (nLayerId == rDoc.GetInvisibleHellId())
{
rSdrObj.SetLayer( rDoc.GetInvisibleHeavenId() );
@@ -1756,7 +1685,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( SvxLRSpaceItem( RES_LR_SPACE ) );
pNewSet->Put( SvxULSpaceItem( RES_UL_SPACE ) );
- // OD 2004-04-15 #i26791# - set position of the drawing object, which is labeled.
+ // #i26791# - set position of the drawing object, which is labeled.
pNewSet->Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
pNewSet->Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
@@ -1771,7 +1700,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
if( pUndo )
{
pUndo->SetFlys( *pOldFmt, *pNewSet, *pNewFmt );
- // OD 2004-04-15 #i26791# - position no longer needed
+ // #i26791# - position no longer needed
pUndo->SetDrawObj( nLayerId );
}
else
@@ -1783,7 +1712,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
- ASSERT( pNew, "No Label inserted" );
+ OSL_ENSURE( pNew, "No Label inserted" );
if( pNew )
{
@@ -1890,7 +1819,6 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel(
|* IDocumentTimerAccess-methods
|*
|*************************************************************************/
-
void SwDoc::StartIdling()
{
mbStartIdleTimer = sal_True;
@@ -1917,16 +1845,11 @@ void SwDoc::UnblockIdling()
aIdleTimer.Start();
}
-
/*************************************************************************
|*
|* SwDoc::DoIdleJobs()
|*
-|* Ersterstellung OK 30.03.94
-|* Letzte Aenderung MA 09. Jun. 95
-|*
|*************************************************************************/
-
IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
{
#ifdef TIMELOG
@@ -1955,8 +1878,8 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
{
sal_Bool bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
sal_Bool bIsAutoGrammar = sal_False;
- SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii(
- UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar;
+ SvtLinguConfig().GetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ UPN_IS_GRAMMAR_AUTO )) ) >>= bIsAutoGrammar;
if (bIsOnlineSpell && bIsAutoGrammar)
StartGrammarChecking( *this );
@@ -2299,7 +2222,7 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const
}
if( n >= GetSpzFrmFmts()->Count() )
{
- ASSERT( mbInReading, "Fly-Section aber kein Format gefunden" );
+ OSL_ENSURE( mbInReading, "Fly-Section aber kein Format gefunden" );
return sal_False;
}
}
@@ -2315,13 +2238,12 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode();
- // --> OD 2005-02-21 #i42921# - use new method <SwCntntNode::GetTextDirection(..)>
+ // #i42921# - use new method <SwCntntNode::GetTextDirection(..)>
if ( pNd )
{
nRet = pNd->GetTextDirection( rPos, pPt );
}
if ( nRet == -1 )
- // <--
{
const SvxFrameDirectionItem* pItem = 0;
if( pNd )
@@ -2438,3 +2360,5 @@ std::set<SwRootFrm*> SwDoc::GetAllLayouts()
return aAllLayouts;
}//swmod 070825
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 98ad5724f10d..5c18528525f7 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,37 +103,29 @@
#include <cmdid.h> // fuer den dflt - Printer in SetJob
-// --> OD 2006-04-19 #b6375613#
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-// <--
-
-// --> OD 2007-03-16 #i73788#
#include <pausethreadstarting.hxx>
-// <--
#include <numrule.hxx>
-// --> OD 2008-03-13 #refactorlists#
#include <list.hxx>
#include <listfunc.hxx>
-// <--
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <sfx2/Metadatable.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::document;
-const sal_Char __FAR_DATA sFrmFmtStr[] = "Frameformat";
-const sal_Char __FAR_DATA sEmptyPageStr[] = "Empty Page";
-const sal_Char __FAR_DATA sColumnCntStr[] = "Columncontainer";
-const sal_Char __FAR_DATA sCharFmtStr[] = "Zeichenformat";
-const sal_Char __FAR_DATA sTxtCollStr[] = "Textformatvorlage";
-const sal_Char __FAR_DATA sGrfCollStr[] = "Graphikformatvorlage";
+const sal_Char sFrmFmtStr[] = "Frameformat";
+const sal_Char sEmptyPageStr[] = "Empty Page";
+const sal_Char sColumnCntStr[] = "Columncontainer";
+const sal_Char sCharFmtStr[] = "Zeichenformat";
+const sal_Char sTxtCollStr[] = "Textformatvorlage";
+const sal_Char sGrfCollStr[] = "Graphikformatvorlage";
SV_IMPL_PTRARR( SwNumRuleTbl, SwNumRulePtr)
SV_IMPL_PTRARR( SwTxtFmtColls, SwTxtFmtCollPtr)
@@ -141,7 +134,6 @@ SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr)
/*
* global functions...
*/
-
uno::Reference< linguistic2::XProofreadingIterator > SwDoc::GetGCIterator() const
{
if (!m_xGCIterator.is() && SvtLinguConfig().HasGrammarChecker())
@@ -151,13 +143,13 @@ SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr)
{
try
{
- rtl::OUString aServiceName( rtl::OUString::createFromAscii("com.sun.star.linguistic2.ProofreadingIterator") );
+ rtl::OUString aServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ProofreadingIterator"));
m_xGCIterator = uno::Reference< linguistic2::XProofreadingIterator >
( xMgr->createInstance( aServiceName ), uno::UNO_QUERY_THROW );
}
catch (uno::Exception &)
{
- DBG_ERROR( "No GCIterator" );
+ OSL_FAIL( "No GCIterator" );
}
}
}
@@ -200,9 +192,6 @@ void StartGrammarChecking( SwDoc &rDoc )
/*
* interne Funktionen
*/
-
-
-
sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
{
SwFmtCntnt &rFmtCntnt = (SwFmtCntnt&)rpFmt->GetCntnt();
@@ -217,7 +206,6 @@ sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
/*
* exportierte Methoden
*/
-
SwDoc::SwDoc()
: m_pNodes( new SwNodes(this) )
,
@@ -261,27 +249,21 @@ SwDoc::SwDoc()
pURLStateChgd( 0 ),
pNumberFormatter( 0 ),
pNumRuleTbl( new SwNumRuleTbl ),
- // --> OD 2008-03-26 #refactorlists#
maLists(),
maListStyleLists(),
- // <--
pRedlineTbl( new SwRedlineTbl ),
pAutoFmtRedlnComment( 0 ),
pUnoCrsrTbl( new SwUnoCrsrTbl( 0, 16 ) ),
pPgPViewPrtData( 0 ),
pExtInputRing( 0 ),
pLayouter( 0 ),
- // --> OD 2008-03-07 #refactorlists#
pStyleAccess( 0 ),
- // <--
pLayoutCache( 0 ),
pUnoCallBack(new SwModify(0)),
mpGrammarContact( 0 ),
aChartDataProviderImplRef(),
pChartControllerHelper( 0 ),
- // --> OD 2007-10-31 #i83479#
- mpListItemsList( new tImplSortedNodeNumList() ),
- // <--
+ mpListItemsList( new tImplSortedNodeNumList() ), // #i83479#
m_pXmlIdRegistry(),
nAutoFmtRedlnCommentNo( 0 ),
nLinkUpdMode( GLOBALSETTING ),
@@ -292,12 +274,10 @@ SwDoc::SwDoc()
mIdleBlockCount(0),
nLockExpFld( 0 ),
mbReadlineChecked(false),
- // --> OD 2005-02-11 #i38810#
- mbLinksUpdated( sal_False ),
+ mbLinksUpdated( sal_False ), //#i38810#
mbClipBoard( false ),
mbColumnSelection( false ),
- // i#78591#
- mbProtectForm(false),
+ mbProtectForm(false), // i#78591#
mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
@@ -329,12 +309,10 @@ SwDoc::SwDoc()
mbInsOnlyTxtGlssry =
mbContains_MSVBasic =
mbKernAsianPunctuation =
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mbXMLExport =
#endif
- // --> OD 2006-03-21 #b6375613#
mbApplyWorkaroundForB6375613 =
- // <--
false;
mbNewFldLst =
@@ -375,9 +353,9 @@ SwDoc::SwDoc()
mbUnixForceZeroExtLeading = false; // hidden
mbOldPrinterMetrics = false; // hidden
mbTabRelativeToIndent = true; // hidden
- // --> OD 2008-06-05 #i89181#
- mbTabAtLeftIndentForParagraphsInList = false; // hidden
- // <--
+ mbTabAtLeftIndentForParagraphsInList = false; // hidden #i89181#
+ mbInvertBorderSpacing = false; // hidden
+ mbCollapseEmptyCellPara = true; // hidden
//
// COMPATIBILITY FLAGS END
@@ -415,18 +393,13 @@ SwDoc::SwDoc()
_InitFieldTypes();
// lege (fuer die Filter) eine Default-OutlineNumRule an
- // --> OD 2008-02-11 #newlistlevelattrs#
pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(),
- // <--
OUTLINE_RULE );
- // <--
- // #115901#
AddNumRule(pOutlineRule);
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // Counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- // <--
new SwTxtNode(
SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
@@ -447,7 +420,6 @@ SwDoc::SwDoc()
// create TOXTypes
InitTOXTypes();
- // --> OD 2008-03-07 #refactorlists#
// pass empty item set containing the paragraph's list attributes
// as ignorable items to the stype manager.
{
@@ -456,7 +428,6 @@ SwDoc::SwDoc()
0 );
pStyleAccess = createStyleManager( &aIgnorableParagraphItems );
}
- // <--
ResetModified();
}
@@ -467,8 +438,6 @@ SwDoc::SwDoc()
* Dieser darf also keinesfalls durch delete geloescht
* werden!!!!!!!!!!
*/
-
-
SwDoc::~SwDoc()
{
// nothing here should create Undo actions!
@@ -479,14 +448,10 @@ SwDoc::~SwDoc()
pDocShell->SetUndoManager(0);
}
- // --> OD 2007-03-16 #i73788#
- SwPauseThreadStarting aPauseThreadStarting;
- // <--
- // --> OD 2007-11-01 #i83479#
+ // #i83479#
delete mpListItemsList;
mpListItemsList = 0;
- // <--
// clean up chart related structures...
// Note: the chart data provider gets already diposed in ~SwDocShell
@@ -514,9 +479,7 @@ SwDoc::~SwDoc()
delete pURLStateChgd;
delete pLayouter;
- // --> OD 2005-09-05 #125370#
pLayouter = 0L;
- // <--
// Undo-Benachrichtigung vom Draw abschalten
if( pDrawModel )
@@ -610,7 +573,7 @@ SwDoc::~SwDoc()
pFtnInfo->ReleaseCollection();
pEndNoteInfo->ReleaseCollection();
- ASSERT( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
+ OSL_ENSURE( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
"Default-Text-Collection muss immer am Anfang stehen" );
// JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
@@ -621,7 +584,7 @@ SwDoc::~SwDoc()
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
delete pTxtFmtCollTbl;
- ASSERT( pDfltGrfFmtColl == (*pGrfFmtCollTbl)[0],
+ OSL_ENSURE( pDfltGrfFmtColl == (*pGrfFmtCollTbl)[0],
"Default-Grf-Collection muss immer am Anfang stehen" );
pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 );
@@ -669,9 +632,8 @@ SwDoc::~SwDoc()
delete pDfltGrfFmtColl;
delete pNumRuleTbl;
- // --> OD 2008-03-26 #refactorlists#
{
- for ( std::hash_map< String, SwList*, StringHash >::iterator
+ for ( boost::unordered_map< String, SwList*, StringHash >::iterator
aListIter = maLists.begin();
aListIter != maLists.end();
++aListIter )
@@ -681,7 +643,6 @@ SwDoc::~SwDoc()
maLists.clear();
}
maListStyleLists.clear();
- // <--
delete pPrtData;
delete pNumberFormatter;
@@ -702,19 +663,15 @@ SwDoc::~SwDoc()
SfxItemPool::Free(mpAttrPool);
}
-//---------------------------------------------------
-
VirtualDevice& SwDoc::CreateVirtualDevice_() const
{
VirtualDevice* pNewVir = new VirtualDevice( 1 );
- // <--
pNewVir->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
- // --> FME 2006-10-09 #i60945# External leading compatibility for unix systems.
+ // #i60945# External leading compatibility for unix systems.
if ( get(IDocumentSettingAccess::UNIX_FORCE_ZERO_EXT_LEADING ) )
pNewVir->Compat_ZeroExtleadBug();
- // <--
MapMode aMapMode( pNewVir->GetMapMode() );
aMapMode.SetMapUnit( MAP_TWIP );
@@ -724,14 +681,12 @@ VirtualDevice& SwDoc::CreateVirtualDevice_() const
return *pVirDev;
}
-//---------------------------------------------------
-
SfxPrinter& SwDoc::CreatePrinter_() const
{
- ASSERT( ! pPrt, "Do not call CreatePrinter_(), call getPrinter() instead" )
+ OSL_ENSURE( ! pPrt, "Do not call CreatePrinter_(), call getPrinter() instead" );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "Printer will be created!" )
+ OSL_FAIL( "Printer will be created!" );
#endif
// wir erzeugen einen default SfxPrinter.
@@ -747,7 +702,6 @@ SfxPrinter& SwDoc::CreatePrinter_() const
const_cast<SwDoc*>(this)->setPrinter( pNewPrt, true, true );
return *pPrt;
}
-//---------------------------------------------------
void SwDoc::SetDocShell( SwDocShell* pDSh )
{
@@ -769,18 +723,14 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
{
((SwDrawDocument*)pDrawModel)->SetObjectShell( pDocShell );
pDrawModel->SetPersist( pDocShell );
- ASSERT( pDrawModel->GetPersist() == GetPersist(),
+ OSL_ENSURE( pDrawModel->GetPersist() == GetPersist(),
"draw model's persist is out of sync" );
}
}
}
-
// Convenience-Methode, um uebermaessige Includes von docsh.hxx
// zu vermeiden
-
-
-
uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
{
if( pDocShell )
@@ -790,14 +740,11 @@ uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
return NULL;
}
-
-
SfxObjectShell* SwDoc::GetPersist() const
{
return pDocShell ? pDocShell : pLinkMgr->GetPersist();
}
-
void SwDoc::ClearDoc()
{
GetIDocumentUndoRedo().DelAllUndoObj();
@@ -814,7 +761,7 @@ void SwDoc::ClearDoc()
sal_uInt16 n;
while ( 0 != (n = GetSpzFrmFmts()->Count()) )
DelLayoutFmt((*pSpzFrmFmtTbl)[n-1]);
- ASSERT( !pDrawModel || !pDrawModel->GetPage(0)->GetObjCount(),
+ OSL_ENSURE( !pDrawModel || !pDrawModel->GetPage(0)->GetObjCount(),
"not all DrawObjects removed from the page" );
pRedlineTbl->DeleteAndDestroy( 0, pRedlineTbl->Count() );
@@ -848,24 +795,19 @@ void SwDoc::ClearDoc()
GetNodes().Delete( aSttIdx,
GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
- // --> OD 2006-02-28 #i62440#
+ // #i62440#
// destruction of numbering rules and creation of new outline rule
// *after* the document nodes are deleted.
pOutlineRule = NULL;
pNumRuleTbl->DeleteAndDestroy( 0, pNumRuleTbl->Count() );
// creation of new outline numbering rule
- // --> OD 2008-02-11 #newlistlevelattrs#
pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(),
- // <--
OUTLINE_RULE );
- // <--
AddNumRule(pOutlineRule);
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // Counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- // <--
- // <--
//remove the dummy pagedec from the array and delete all the old ones
aPageDescs.Remove( nDummyPgDsc );
@@ -876,9 +818,9 @@ void SwDoc::ClearDoc()
pFtnInfo->ReleaseCollection();
pEndNoteInfo->ReleaseCollection();
- // JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
- // steht, sollte das als letztes geloescht werden, damit
- // die ganze Umhaengerei der Formate vermieden wird!
+ // opt.: ausgehend davon, das Standard als 2. im Array
+ // steht, sollte das als letztes geloescht werden, damit
+ // die ganze Umhaengerei der Formate vermieden wird!
if( 2 < pTxtFmtCollTbl->Count() )
pTxtFmtCollTbl->DeleteAndDestroy( 2, pTxtFmtCollTbl->Count()-2 );
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
@@ -895,7 +837,7 @@ void SwDoc::ClearDoc()
else //swmod 071029//swmod 071225
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
- xForbiddenCharsTable.unbind();
+ xForbiddenCharsTable.clear();
pFldTypes->DeleteAndDestroy( INIT_FLDTYPES,
pFldTypes->Count() - INIT_FLDTYPES );
@@ -925,19 +867,16 @@ void SwDoc::SetPreViewPrtData( const SwPagePreViewPrtData* pNew )
DELETEZ( pPgPViewPrtData );
SetModified();
}
-/* -----------------------------06.01.00 14:03--------------------------------
- ---------------------------------------------------------------------------*/
SwModify* SwDoc::GetUnoCallBack() const
{
return pUnoCallBack;
}
-/*-----------------28.5.2001 10:06------------------
- * SwDoc:
+
+/** SwDoc:
* Reading and writing of the layout cache.
*--------------------------------------------------*/
-
void SwDoc::ReadLayoutCache( SvStream& rStream )
{
if( !pLayoutCache )
@@ -963,8 +902,8 @@ IGrammarContact* getGrammarContact( const SwTxtNode& rTxtNode )
return pDoc->getGrammarContact();
}
-// --> FME 2005-02-25 #i42634# Moved common code of SwReader::Read() and
-// SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
+// #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks()
+// to new SwDoc::UpdateLinks():
void SwDoc::UpdateLinks( sal_Bool bUI )
{
SfxObjectCreateMode eMode;
@@ -1006,8 +945,7 @@ void SwDoc::UpdateLinks( sal_Bool bUI )
}
}
-// <--
-// --> OD 2006-04-19 #b6375613#
+
void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
{
if ( mbApplyWorkaroundForB6375613 != p_bApplyWorkaroundForB6375613 )
@@ -1029,13 +967,13 @@ void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
if ( mbApplyWorkaroundForB6375613 )
{
xDocInfo->addProperty(
- rtl::OUString::createFromAscii("WorkaroundForB6375613Applied"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")),
beans::PropertyAttribute::TRANSIENT | beans::PropertyAttribute::REMOVABLE,
uno::makeAny( false ) );
}
else
{
- xDocInfo->removeProperty( rtl::OUString::createFromAscii("WorkaroundForB6375613Applied") );
+ xDocInfo->removeProperty( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")) );
}
}
catch( uno::Exception& )
@@ -1045,7 +983,6 @@ void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
}
}
}
-// <--
::sfx2::IXmlIdRegistry&
SwDoc::GetXmlIdRegistry()
@@ -1107,20 +1044,15 @@ void SwDoc::InitTOXTypes()
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
}
-/*-- 08.05.2009 10:07:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
{
SwDoc* pRet = new SwDoc;
//copy settings
- sal_uInt16 __FAR_DATA aRangeOfDefaults[] = {
+ sal_uInt16 aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists##
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
@@ -1192,7 +1124,8 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
return pRetShell;
}
-/*-- 08.05.2009 10:52:40---------------------------------------------------
+
+/*-------------------------------------------------------------------------
copy document content - code from SwFEShell::Paste( SwDoc* , sal_Bool )
-----------------------------------------------------------------------*/
void SwDoc::Paste( const SwDoc& rSource )
@@ -1267,3 +1200,5 @@ void SwDoc::Paste( const SwDoc& rSource )
UnlockExpFlds();
UpdateFlds(NULL, false);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 72e1010da86c..b184b636162b 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,21 +90,17 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
}
pOutlineRule->SetRuleType( OUTLINE_RULE );
- // --> OD 2008-07-08 #i91400#
pOutlineRule->SetName( String::CreateFromAscii(
SwNumRule::GetOutlineRuleName() ),
*this);
- // <--
- // --> OD 2006-09-21 #i69522#
+
// assure that the outline numbering rule is an automatic rule
pOutlineRule->SetAutoRule( sal_True );
- // <--
// teste ob die evt. gesetzen CharFormate in diesem Document
// definiert sind
pOutlineRule->CheckCharFmts( this );
- // --> OD 2008-05-13 #refactorlists#
// notify text nodes, which are registered at the outline style, about the
// changed outline style
SwNumRule::tTxtNodeList aTxtNodeList;
@@ -113,16 +110,14 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
{
SwTxtNode* pTxtNd = *aIter;
pTxtNd->NumRuleChgd();
- // --> OD 2009-01-20 #i94152#
+
// assure that list level corresponds to outline level
if ( pTxtNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() &&
pTxtNd->GetAttrListLevel() != pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() )
{
pTxtNd->SetAttrListLevel( pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() );
}
- // <--
}
- // <--
PropagateOutlineRule();
pOutlineRule->SetInvalidRule(sal_True);
@@ -143,18 +138,13 @@ void SwDoc::PropagateOutlineRule()
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
- // if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei
if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
- // --> OD 2006-11-20 #i71764#
// Check only the list style, which is set at the paragraph style
const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
- // <--
- // --> OD 2006-11-20 #i71764#
// Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
if ( rCollRuleItem.GetValue().Len() == 0 )
- // <--
{
SwNumRule * pMyOutlineRule = GetOutlineNumRule();
@@ -169,7 +159,7 @@ void SwDoc::PropagateOutlineRule()
}
}
- // Hoch-/Runterstufen
+// Hoch-/Runterstufen
sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
if( !GetNodes().GetOutLineNds().Count() || !nOffset )
@@ -201,9 +191,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
for( n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
- //sal_uInt8 nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nLevel < MAXLEVEL )
- // aCollArr[ nLevel ] = (*pTxtFmtCollTbl)[ n ];
if((*pTxtFmtCollTbl)[ n ]->IsAssignedToListLevelOfOutlineStyle())
{
const int nLevel = (*pTxtFmtCollTbl)[ n ]->GetAssignedOutlineStyleLevel();
@@ -211,7 +198,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}//<-end,zhaojianwei
}
- /* --> #111107# */
/* Find the last occupied level (backward). */
for (n = MAXLEVEL - 1; n > 0; n--)
{
@@ -232,7 +218,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
SwTxtFmtColl *aTmpColl =
GetTxtCollFromPool(static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + n));
- //if (aTmpColl->GetOutlineLevel() == n)//#outline level,zhaojianwei
if( aTmpColl->IsAssignedToListLevelOfOutlineStyle() &&
aTmpColl->GetAssignedOutlineStyleLevel() == n )//<-end,zhaojianwei
{
@@ -271,7 +256,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}
}
}
- /* <-- #111107# */
/* --> #i13747#
@@ -343,16 +327,14 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
-// int nLevel = pColl->GetOutlineLevel();//#outline level,zhaojianwei
-// if (aMoveArr[nLevel] == -1)
-// bMoveApplicable = false;
+
if( pColl->IsAssignedToListLevelOfOutlineStyle() )
{
const int nLevel = pColl->GetAssignedOutlineStyleLevel();
if (aMoveArr[nLevel] == -1)
bMoveApplicable = false;
}//<-end,zhaojianwei
- // --> OD 2008-12-16 #i70748#
+
// Check on outline level attribute of text node, if text node is
// not an outline via a to outline style assigned paragraph style.
else
@@ -363,13 +345,11 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
bMoveApplicable = false;
}
}
- // <--
}
if (! bMoveApplicable )
return sal_False;
- /* <-- #i13747 # */
if (GetIDocumentUndoRedo().DoesUndo())
{
GetIDocumentUndoRedo().StartUndo(UNDO_OUTLINE_LR, NULL);
@@ -387,12 +367,9 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
if( pColl->IsAssignedToListLevelOfOutlineStyle() )
{
- // ASSERT(pColl->GetOutlineLevel() < MAXLEVEL, //#outline level,removed by zhaojianwei
- // "non outline node in outline nodes?");
- //int nLevel = pColl->GetOutlineLevel();
const int nLevel = pColl->GetAssignedOutlineStyleLevel();//#outline level,add by zhaojianwei
- ASSERT(aMoveArr[nLevel] >= 0,
+ OSL_ENSURE(aMoveArr[nLevel] >= 0,
"move table: current TxtColl not found when building table!");
@@ -427,9 +404,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
return sal_True;
}
-
-
- // Hoch-/Runter - Verschieben !
+// Hoch-/Runter - Verschieben !
sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
{
// kein Verschiebung in den Sonderbereichen
@@ -446,11 +421,9 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
sal_uInt16 nAktPos = 0;
SwNodeIndex aSttRg( rStt.nNode ), aEndRg( rEnd.nNode );
- //sal_uInt8 nOutLineLevel = NO_NUMBERING; //#outline level,zhaojianwei
int nOutLineLevel = MAXLEVEL; //<-end,zhaojianwei
SwNode* pSrch = &aSttRg.GetNode();
- //if( pSrch->IsTxtNode() ) //#outline level,zhaojianwei
- // nOutLineLevel = static_cast<sal_uInt8>(((SwTxtNode*)pSrch)->GetOutlineLevel());
+
if( pSrch->IsTxtNode())
nOutLineLevel = static_cast<sal_uInt8>(((SwTxtNode*)pSrch)->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
SwNode* pEndSrch = &aEndRg.GetNode();
@@ -474,7 +447,6 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
{
if( !pEndSrch->IsTxtNode() || pEndSrch == pSrch ||
- //nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetOutlineLevel() )//#outline level,zhaojianwei
nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetAttrOutlineLevel()-1 )//<-end,zhaojianwei
++nTmpPos; // For sub outlines only!
}
@@ -486,7 +458,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
nAktPos = nTmpPos;
if( aEndRg == aSttRg )
{
- ASSERT( false, "Moving outlines: Surprising selection" );
+ OSL_FAIL( "Moving outlines: Surprising selection" );
aEndRg++;
}
@@ -568,7 +540,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( pNd->FindTableNode() )
return sal_False;
- ASSERT( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
+ OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
"Position liegt im MoveBereich" );
// wurde ein Position in den Sonderbereichen errechnet, dann
@@ -582,7 +554,6 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
return MoveParagraph( aPam, nOffs, sal_True );
}
-
sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
sal_Bool bExact )
{
@@ -609,8 +580,6 @@ sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
return nSavePos;
}
-
-
sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
{
// Gueltig Nummern sind (immer nur Offsets!!!):
@@ -657,7 +626,7 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
// Gliederung:
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
// OS: ohne OutlineNodes lohnt die Suche nicht
- // und man spart sich einen Absturz #42958#
+ // und man spart sich einen Absturz
if(!rOutlNds.Count())
return USHRT_MAX;
SwTxtNode* pNd;
@@ -666,16 +635,12 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
for( ; nPos < rOutlNds.Count(); ++nPos )
{
pNd = rOutlNds[ nPos ]->GetTxtNode();
- //sal_uInt8 nLvl = pNd->GetTxtColl()->GetOutlineLevel(); //#outline level,zhaojianwei
const int nLvl = pNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
if( nLvl == nLevel - 1)
{
- // check for the outline num
- // --> OD 2005-11-02 #i51089 - TUNING#
- // --> OD 2006-09-22 #i68289#
+ // #i51089#, #i68289#
// Assure, that text node has the correct numbering level. Otherwise,
// its number vector will not fit to the searched level.
-// if ( pNd->GetNum() )
if ( pNd->GetNum() &&
pNd->GetActualListLevel() == ( nLevel - 1 ) )
// <--
@@ -695,12 +660,11 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
}
else
{
- // --> OD 2006-01-12 #126588#
// A text node, which has an outline paragraph style applied and
// has as hard attribute 'no numbering' set, has an outline level,
// but no numbering tree node. Thus, consider this situation in
// the assertion condition.
- ASSERT( !pNd->GetNumRule(),
+ OSL_ENSURE( !pNd->GetNumRule(),
"<lcl_FindOutlineNum(..)> - text node with outline level and numbering rule, but without numbering tree node. This is a serious defect -> inform OD" );
}
}
@@ -710,18 +674,16 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
return nPos;
}
- // zu diesem Gliederungspunkt
-
-
- // JP 13.06.96:
- // im Namen kann eine Nummer oder/und der Text stehen.
- // zuerst wird ueber die Nummer versucht den richtigen Eintrag zu finden.
- // Gibt es diesen, dann wird ueber den Text verglichen, od es der
- // gewuenschte ist. Ist das nicht der Fall, wird noch mal nur ueber den
- // Text gesucht. Wird dieser gefunden ist es der Eintrag. Ansonsten der,
- // der ueber die Nummer gefunden wurde.
- // Ist keine Nummer angegeben, dann nur den Text suchen.
+// zu diesem Gliederungspunkt
+// JP 13.06.96:
+// im Namen kann eine Nummer oder/und der Text stehen.
+// zuerst wird ueber die Nummer versucht den richtigen Eintrag zu finden.
+// Gibt es diesen, dann wird ueber den Text verglichen, od es der
+// gewuenschte ist. Ist das nicht der Fall, wird noch mal nur ueber den
+// Text gesucht. Wird dieser gefunden ist es der Eintrag. Ansonsten der,
+// der ueber die Nummer gefunden wurde.
+// Ist keine Nummer angegeben, dann nur den Text suchen.
sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
{
if( rName.Len() )
@@ -771,8 +733,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
return sal_True;
}
- // --> OD 2006-09-22 #i68289#
- // additional search on hyperlink URL without its outline numbering part
+ // #i68289# additional search on hyperlink URL without its outline numbering part
if ( !sName.Equals( rName ) )
{
nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, sal_False );
@@ -784,96 +745,14 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
return sal_True;
}
}
- // <--
}
return sal_False;
}
-/* */
-
-// --- Nummerierung -----------------------------------------
-
-// --> OD 2008-02-19 #refactorlists#
-//void SwNumRuleInfo::MakeList( SwDoc& rDoc, sal_Bool )
-//{
-// SwNumRule* pRule = rDoc.FindNumRulePtr(rName);
-
-// // no rule, no fun.
-// if ( !pRule )
-// return;
-
-// //
-// // 1. Case: Information already available at pRule:
-// //
-// if (pRule->GetTxtNodeList())
-// {
-// // copy list to own pList pointer:
-// aList = *pRule->GetTxtNodeList();
-// return;
-// }
-
-// //
-// // 2. Case: Information has to be generated from scratch:
-// //
-
-// if (pRule->IsOutlineRule())
-// {
-// const SwOutlineNodes & rOutlineNodes = rDoc.GetNodes().GetOutLineNds();
-
-// for (sal_uInt16 i = 0; i < rOutlineNodes.Count(); ++i)
-// {
-// SwTxtNode & aNode = *((SwTxtNode *) rOutlineNodes[i]);
-
-// if (pRule == aNode.GetNumRule())
-// AddNode(aNode);
-// }
-// }
-// {
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 i, nMaxItems = rDoc.GetAttrPool().GetItemCount
-// ( RES_PARATR_NUMRULE);
-// for( i = 0; i < nMaxItems; ++i )
-// {
-// pItem = rDoc.GetAttrPool().GetItem( RES_PARATR_NUMRULE, i );
-// if( 0 != pItem)
-// {
-// pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn();
-// if (0 != pMod &&
-// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rName )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// pMod->GetInfo( *this );
-// else
-// {
-// SwTxtNode* pModTxtNode = (SwTxtNode*)pMod;
-
-// // #115901#
-// if( pModTxtNode->GetNodes().IsDocNodes())
-// {
-// AddNode( *pModTxtNode );
-// }
-// }
-// }
-// }
-// }
-// }
-
-// // --> FME 2004-11-03 #i36571# The numrule and this info structure should
-// // have different instances of the list:
-// // --> OD 2006-09-12 #i69145#
-// // method <SwNumRule::SetList(..)> copies content of list provided by the parameter
-// pRule->SetTxtNodeList( aList );
-// // <--
-//}
-// <--
-
-
void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
{
SwNumRule* pOld = rDoc.FindNumRulePtr( rRule.GetName() );
- ASSERT( pOld, "ohne die alte NumRule geht gar nichts" );
+ OSL_ENSURE( pOld, "ohne die alte NumRule geht gar nichts" );
sal_uInt16 nChgFmtLevel = 0, nMask = 1;
sal_uInt8 n;
@@ -894,43 +773,18 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
if( !nChgFmtLevel ) // es wurde nichts veraendert?
{
- // --> OD 2006-04-27 #i64311#
const bool bInvalidateNumRule( pOld->IsContinusNum() != rRule.IsContinusNum() );
- // <--
pOld->CheckCharFmts( &rDoc );
pOld->SetContinusNum( rRule.IsContinusNum() );
- // --> OD 2008-06-17 #i87166#
- // Do NOT change list style type
-// pOld->SetRuleType( rRule.GetRuleType() );
- // <--
- // --> OD 2006-04-27 #i64311#
+
if ( bInvalidateNumRule )
{
pOld->SetInvalidRule(sal_True);
}
- // <--
+
return ;
}
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo* pUpd = new SwNumRuleInfo( rRule.GetName() );
-// pUpd->MakeList( rDoc );
-
-// sal_uInt8 nLvl;
-// for( sal_uLong nFirst = 0, nLast = pUpd->GetList().Count();
-// nFirst < nLast; ++nFirst )
-// {
-// SwTxtNode* pTxtNd = pUpd->GetList().GetObject( nFirst );
-// nLvl = static_cast<sal_uInt8>(pTxtNd->GetLevel());
-
-// if( nLvl < MAXLEVEL )
-// {
-// if( nChgFmtLevel & ( 1 << nLvl ))
-// {
-// pTxtNd->NumRuleChgd();
-// }
-// }
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
pOld->GetTxtNodeList( aTxtNodeList );
sal_uInt8 nLvl( 0 );
@@ -948,7 +802,6 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
}
}
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
if( nChgFmtLevel & ( 1 << n ))
@@ -957,20 +810,10 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
pOld->CheckCharFmts( &rDoc );
pOld->SetInvalidRule(sal_True);
pOld->SetContinusNum( rRule.IsContinusNum() );
- // --> OD 2008-06-17 #i87166#
- // Do NOT change list style type
-// pOld->SetRuleType( rRule.GetRuleType() );
- // <--
-
- // --> OD 2008-02-19 #refactorlists#
-// delete pUpd;
- // <--
rDoc.UpdateNumRule();
}
-// OD 2008-02-08 #newlistlevelattrs# - add handling of parameter <bResetIndentAttrs>
-// --> OD 2008-03-17 #refactorlists#
void SwDoc::SetNumRule( const SwPaM& rPam,
const SwNumRule& rRule,
const bool bCreateNewList,
@@ -1013,7 +856,6 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
- // --> OD 2008-03-17 #refactorlists#
if ( bSetItem )
{
if ( bCreateNewList )
@@ -1028,7 +870,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
{
// create new list and apply its list id
SwList* pNewList = createList( String(), pNew->GetName() );
- ASSERT( pNewList,
+ OSL_ENSURE( pNewList,
"<SwDoc::SetNumRule(..)> - could not create new list. Serious defect -> please inform OD." );
sListId = pNewList->GetListId();
}
@@ -1042,12 +884,10 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
}
}
- // <--
if ( ! rPam.HasMark())
{
SwTxtNode * pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
- // --> OD 2006-10-19 #134160#
// consider case that the PaM doesn't denote a text node - e.g. it denotes a graphic node
if ( pTxtNd )
{
@@ -1056,15 +896,14 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
if (pRule && pRule->GetName() == pNew->GetName())
{
bSetItem = sal_False;
- // --> OD 2008-06-02 #refactorlists#
+
if ( !pTxtNd->IsInList() )
{
pTxtNd->AddToList();
}
- // <--
}
- // --> OD 2005-10-26 #b6340308# - only clear numbering attribute at
- // text node, if at paragraph style the new numbering rule is found.
+ // Only clear numbering attribute at text node, if at paragraph
+ // style the new numbering rule is found.
else if ( !pRule )
{
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
@@ -1078,19 +917,14 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
}
- // <--
}
- // <--
}
- // --> OD 2009-08-18 #i103817#
if ( bSetItem )
- // <--
{
InsertPoolItem( rPam, SwNumRuleItem( pNew->GetName() ), 0 );
}
- // --> OD 2008-02-08 #newlistlevelattrs#
if ( bResetIndentAttrs &&
pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
@@ -1114,7 +948,6 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
// <--
}
- // <--
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1183,19 +1016,6 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
if (pTxtNd)
{
- // --> OD 2008-02-27 #refactorlists#
-// const SwNumRule* pRule = pTxtNd->GetNumRule();
-// if( pRule && nStt != pTxtNd->GetListRestartValue() )
-// {
-// if( DoesUndo() )
-// {
-// ClearRedo();
-// AppendUndo( new SwUndoNumRuleStart( rPos, nStt ));
-// }
-// }
-// pTxtNd->SetListRestartValue(nStt);
-
-// SetModified();
if ( !pTxtNd->HasAttrListRestartValue() ||
pTxtNd->GetAttrListRestartValue() != nStt )
{
@@ -1208,23 +1028,19 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
SetModified();
}
- // <--
}
}
- // loeschen geht nur, wenn die Rule niemand benutzt!
+// loeschen geht nur, wenn die Rule niemand benutzt!
sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
{
sal_uInt16 nPos = FindNumRule( rName );
- // --> OD 2007-12-17 #151213#
if ( (*pNumRuleTbl)[ nPos ] == GetOutlineNumRule() )
{
- ASSERT( false,
- "<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect - please inform OD" );
+ OSL_FAIL( "<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect - please inform OD" );
return sal_False;
}
- // <--
if( USHRT_MAX != nPos && !IsUsed( *(*pNumRuleTbl)[ nPos ] ))
{
@@ -1239,7 +1055,6 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PSEUDO,
SFX_STYLESHEET_ERASED);
- // --> OD 2008-04-02 #refactorlists#
deleteListForListStyle( rName );
{
// delete further list, which have the deleted list style as default list style
@@ -1262,7 +1077,6 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
deleteList( pList->GetListId() );
}
}
- // <--
// --> FME 2004-11-02 #i34097# DeleteAndDestroy deletes rName if
// rName is directly taken from the numrule.
const String aTmpName( rName );
@@ -1276,10 +1090,8 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
return sal_False;
}
-// #106897#
void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName )
{
- // #106897#
SwNumRule* pRule = FindNumRulePtr( pName ? *pName : rRule.GetName() );
if( pRule )
{
@@ -1313,31 +1125,19 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo aInfo(rOldName);
-// aInfo.MakeList(*this);
SwNumRule::tTxtNodeList aTxtNodeList;
pNumRule->GetTxtNodeList( aTxtNodeList );
- // <--
- // --> OD 2008-07-08 #i91400#
pNumRule->SetName( rNewName, *this );
- // <--
SwNumRuleItem aItem(rNewName);
- // --> OD 2008-02-19 #refactorlists#
-// for (sal_uLong nI = 0; nI < aInfo.GetList().Count(); ++nI)
-// {
-// SwTxtNode * pTxtNd = aInfo.GetList().GetObject(nI);
-// pTxtNd->SwCntntNode::SetAttr(aItem);
-// }
+
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
aIter != aTxtNodeList.end(); ++aIter )
{
SwTxtNode * pTxtNd = *aIter;
pTxtNd->SetAttr(aItem);
}
- // <--
bResult = sal_True;
@@ -1375,7 +1175,6 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
*pNewRule = FindNumRulePtr( rNewRule );
if( pOldRule && pNewRule && pOldRule != pNewRule )
{
- // --> OD 2008-02-19 #refactorlists#
SwUndoInsNum* pUndo = 0;
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1385,48 +1184,10 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // --> OD 2008-02-19 #refactorlists#
- // apply new list style <pNewRule> to all text nodes, which have the
- // old list style <pOldNRule> applied and belong to the same list as
- // the text node of the given <SwPosition>.
-// SwNumRuleInfo aUpd( rOldRule );
-// aUpd.MakeList( *this );
-
-// if (aUpd.GetList().Count() > 0) // #106897#
SwNumRule::tTxtNodeList aTxtNodeList;
pOldRule->GetTxtNodeList( aTxtNodeList );
if ( aTxtNodeList.size() > 0 )
{
-// // Position suchen und bestimme ob ein Node davor oder dahinter
-// // einen Start erzwingt
-// SwTxtNode* pTxtNd;
-// sal_uLong nFndPos, nFirst, nLast;
-
-// if( TABLE_ENTRY_NOTFOUND != aUpd.GetList().SearchKey(
-// rPos.nNode.GetIndex(), &nFndPos ))
-// ++nFndPos;
-
-// for( nLast = nFndPos; nLast < aUpd.GetList().Count(); ++nLast )
-// {
-// pTxtNd = aUpd.GetList().GetObject( nLast );
-// if(pTxtNd->IsRestart())
-// break;
-// }
-// for( nFirst = nFndPos; nFirst; )
-// {
-// pTxtNd = aUpd.GetList().GetObject( --nFirst );
-// if( pTxtNd->IsRestart() )
-// break;
-// }
-// // dann neue Numerierung ueber diesen Bereich
-// // definieren und den Start am Anfang/Ende zurueck setzen
-// pTxtNd = aUpd.GetList().GetObject( nFirst );
-// if( pTxtNd->IsRestart() )
-// {
-// pTxtNd->SetRestart(false);
-// if( pUndo )
-// pUndo->SetSttNum( pTxtNd->GetIndex() );
-// }
SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 );
sal_uInt16 nChgFmtLevel = 0;
@@ -1442,15 +1203,7 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
const SwTxtNode* pGivenTxtNode = rPos.nNode.GetNode().GetTxtNode();
SwNumRuleItem aRule( rNewRule );
-// for( ; nFirst < nLast; ++nFirst )
-// {
-// pTxtNd = aUpd.GetList().GetObject( nFirst );
-
-// aRegH.RegisterInModify( pTxtNd, *pTxtNd );
-// pTxtNd->SwCntntNode::SetAttr( aRule );
-// pTxtNd->NumRuleChgd();
-// }
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
aIter != aTxtNodeList.end(); ++aIter )
{
@@ -1468,14 +1221,13 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
- bRet = sal_True; // #106897#
+ bRet = sal_True;
}
}
return bRet;
}
-// --> OD 2008-03-18 #refactorlists#
namespace
{
struct ListStyleData
@@ -1491,16 +1243,12 @@ namespace
{}
};
}
-// <--
void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
{
- ASSERT( rPaM.GetDoc() == this, "need same doc" );
+ OSL_ENSURE( rPaM.GetDoc() == this, "need same doc" );
- // --> OD 2008-03-18 #refactorlists#
-// map<SwNumRule *, SwNumRule *> aMyNumRuleMap;
::std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
- // <--
sal_uLong nStt = rPaM.Start()->nNode.GetIndex();
sal_uLong nEnd = rPaM.End()->nNode.GetIndex();
@@ -1517,11 +1265,8 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
if (pRule && pRule->IsAutoRule() && ! pRule->IsOutlineRule())
{
- // --> OD 2008-03-18 #refactorlists#
-// SwNumRule * pReplaceNumRule = aMyNumRuleMap[pRule];
ListStyleData aListStyleData = aMyNumRuleMap[pRule];
-// if (! pReplaceNumRule)
if ( aListStyleData.pReplaceNumRule == 0 )
{
if (bFirst)
@@ -1534,20 +1279,16 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
aListStyleData.sListId, true ));
}
-// if (! pReplaceNumRule)
if ( aListStyleData.pReplaceNumRule == 0 )
{
-// pReplaceNumRule = new SwNumRule(*pRule);
-// pReplaceNumRule->SetName(GetUniqueNumRuleName());
aListStyleData.pReplaceNumRule = new SwNumRule(*pRule);
- // --> OD 2008-07-08 #i91400#
+
aListStyleData.pReplaceNumRule->SetName(
GetUniqueNumRuleName(), *this );
- // <--
+
aListStyleData.bCreateNewList = true;
}
-// aMyNumRuleMap[pRule] = pReplaceNumRule;
aMyNumRuleMap[pRule] = aListStyleData;
}
@@ -1618,13 +1359,8 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
for( ; nStt <= nEnd; ++nStt )
{
SwTxtNode* pTNd = GetNodes()[ nStt ]->GetTxtNode();
- // --> OD 2008-03-13 #refactorlists#
-// if( pTNd && 0 != ( pItem = pTNd->GetNoCondAttr(
-// RES_PARATR_NUMRULE, sal_True ) ) &&
-// ( pName = &((SwNumRuleItem*)pItem)->GetValue())->Len() )
SwNumRule* pNumRuleOfTxtNode = pTNd ? pTNd->GetNumRule() : 0;
if ( pTNd && pNumRuleOfTxtNode )
- // <--
{
// recognize changes of attribute for undo
aRegH.RegisterInModify( pTNd, *pTNd );
@@ -1641,18 +1377,15 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
else
pTNd->SetAttr( aEmptyRule );
- // --> OD 2008-03-26 #refactorlists#
pTNd->ResetAttr( RES_PARATR_LIST_ID );
pTNd->ResetAttr( RES_PARATR_LIST_LEVEL );
pTNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
pTNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
pTNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
- // <--
if( RES_CONDTXTFMTCOLL == pTNd->GetFmtColl()->Which() )
pTNd->ChkCondColl();
- //else if( !pOutlNd && NO_NUMBERING != //#outline level,zhaojianwei
- // ((SwTxtFmtColl*)pTNd->GetFmtColl())->GetOutlineLevel() )
+
else if( !pOutlNd &&
((SwTxtFmtColl*)pTNd->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle() )//<-end,zhaojianwei
pOutlNd = pTNd;
@@ -1672,15 +1405,12 @@ void SwDoc::InvalidateNumRules()
(*pNumRuleTbl)[n]->SetInvalidRule(sal_True);
}
- // zum naechsten/vorhergehenden Punkt auf gleicher Ebene
-
+// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
sal_Bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& rUpper,
sal_Bool bOverUpper, sal_uInt8 nNumber )
{
- // --> OD 2008-04-02 #refactorlists#
- ASSERT( nNumber < MAXLEVEL,
+ OSL_ENSURE( nNumber < MAXLEVEL,
"<lcl_IsNumOk(..)> - misusage of method" );
- // <--
sal_Bool bRet = sal_False;
{
@@ -1832,8 +1562,6 @@ sal_Bool SwDoc::GotoNextNum( SwPosition& rPos, sal_Bool bOverUpper,
return ::lcl_GotoNextPrevNum( rPos, sal_True, bOverUpper, pUpper, pLower );
}
-// -> #i23731#
-// --> OD 2008-03-18 #refactorlists# - add output parameter <sListId>
const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
const bool bForward,
const bool bNum,
@@ -1850,12 +1578,10 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
{
SwNodeIndex aIdx(rPos.nNode);
- // --> OD 2005-10-20 #i55391#
// - the start node has also been investigated, if requested.
const SwNode * pNode = NULL;
do
{
- // --> OD 2005-10-20 #i55391#
if ( !bInvestigateStartNode )
{
if (bForward)
@@ -1863,7 +1589,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
else
aIdx--;
}
- // <--
+
if (aIdx.GetNode().IsTxtNode())
{
pTxtNd = aIdx.GetNode().GetTxtNode();
@@ -1871,12 +1597,11 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
const SwNumRule * pNumRule = pTxtNd->GetNumRule();
if (pNumRule)
{
- if ( ( pNumRule->IsOutlineRule() == ( bOutline ? sal_True : sal_False ) ) && // #115901#
+ if ( ( pNumRule->IsOutlineRule() == ( bOutline ? sal_True : sal_False ) ) &&
( ( bNum && pNumRule->Get(0).IsEnumeration()) ||
( !bNum && pNumRule->Get(0).IsItemize() ) ) ) // #i22362#, #i29560#
{
pResult = pTxtNd->GetNumRule();
- // --> OD 2008-03-18 #refactorlists#
// provide also the list id, to which the text node belongs.
sListId = pTxtNd->GetListId();
}
@@ -1895,7 +1620,6 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
}
}
- // --> OD 2005-10-20 #i55391#
if ( bInvestigateStartNode )
{
if (bForward)
@@ -1903,18 +1627,16 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
else
aIdx--;
}
- // <--
pNode = &aIdx.GetNode();
}
while (!(pNode == GetNodes().DocumentSectionStartNode(pStartFromNode) ||
pNode == GetNodes().DocumentSectionEndNode(pStartFromNode)));
- // <--
}
return pResult;
}
-// <- #i23731#
+
sal_Bool SwDoc::GotoPrevNum( SwPosition& rPos, sal_Bool bOverUpper,
sal_uInt8* pUpper, sal_uInt8* pLower )
@@ -1931,7 +1653,7 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
sal_uLong nTmp = nStt; nStt = nEnd; nEnd = nTmp;
}
- // -> #115901# outline nodes are promoted or demoted differently
+ // -> outline nodes are promoted or demoted differently
bool bOnlyOutline = true;
bool bOnlyNonOutline = true;
for (sal_uLong n = nStt; n <= nEnd; n++)
@@ -1951,17 +1673,15 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
}
}
}
- // <- #115901#
sal_Bool bRet = sal_True;
char nDiff = bDown ? 1 : -1;
- // ->#115901#
if (bOnlyOutline)
bRet = OutlineUpDown(rPam, nDiff);
else if (bOnlyNonOutline)
{
- /* --> #i24560#
+ /* #i24560#
Only promote or demote if all selected paragraphs are
promotable resp. demotable.
@@ -1971,8 +1691,8 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
{
SwTxtNode* pTNd = GetNodes()[ nTmp ]->GetTxtNode();
- // --> OD 2006-10-19 #134160# - make code robust:
- // consider case that the node doesn't denote a text node.
+ // Make code robust: consider case that the node doesn't denote a
+ // text node.
if ( pTNd )
{
SwNumRule * pRule = pTNd->GetNumRule();
@@ -1985,12 +1705,10 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
bRet = sal_False;
}
}
- // <--
}
if( bRet )
{
- /* <-- #i24560# */
if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo *const pUndo( new SwUndoNumUpDown(rPam, nDiff) );
@@ -2235,7 +1953,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
sal_Bool bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode();
- /* #101076# When copying to a non-content node Copy will
+ /* When copying to a non-content node Copy will
insert a paragraph before that node and insert before
that inserted node. Copy creates an SwUndoInserts that
does not cover the extra paragraph. Thus we insert the
@@ -2247,7 +1965,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
the previous content node. */
SwPaM aInsPam(aInsPos);
sal_Bool bMoved = aInsPam.Move(fnMoveBackward);
- ASSERT(bMoved, "No content node found!");
+ OSL_ENSURE(bMoved, "No content node found!");
if (bMoved)
{
@@ -2307,7 +2025,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
SwRedline* pNewRedline = new SwRedline( nsRedlineType_t::REDLINE_DELETE, aPam );
- // #101654# prevent assertion from aPam's target being deleted
+ // prevent assertion from aPam's target being deleted
// (Alternatively, one could just let aPam go out of scope, but
// that requires touching a lot of code.)
aPam.GetBound(sal_True).nContent.Assign( NULL, 0 );
@@ -2428,9 +2146,6 @@ SwNumRule* SwDoc::GetCurrNumRule( const SwPosition& rPos ) const
if( pTNd )
{
- // --> OD 2008-02-20 #refactorlists#
-// pTNd->SyncNumberAndNumRule();
- // <--
pRet = pTNd->GetNumRule();
}
@@ -2468,19 +2183,15 @@ SwNumRule* SwDoc::FindNumRulePtr( const String& rName ) const
return pResult;
}
-// #i36749#
void SwDoc::AddNumRule(SwNumRule * pRule)
{
pNumRuleTbl->Insert(pRule, pNumRuleTbl->Count());
maNumRuleMap[pRule->GetName()] = pRule;
pRule->SetNumRuleMap(&maNumRuleMap);
- // --> OD 2008-03-26 #refactorlists#
createListForListStyle( pRule->GetName() );
- // <--
}
-// --> OD 2008-02-11 #newlistlevelattrs#
sal_uInt16 SwDoc::MakeNumRule( const String &rName,
const SwNumRule* pCpy,
sal_Bool bBroadcast,
@@ -2491,31 +2202,26 @@ sal_uInt16 SwDoc::MakeNumRule( const String &rName,
{
pNew = new SwNumRule( *pCpy );
- // --> OD 2008-07-08 #i91400#
pNew->SetName( GetUniqueNumRuleName( &rName ), *this );
- // <--
+
if( pNew->GetName() != rName )
{
pNew->SetPoolFmtId( USHRT_MAX );
pNew->SetPoolHelpId( USHRT_MAX );
pNew->SetPoolHlpFileId( UCHAR_MAX );
- // --> OD 2008-04-03 #refactorlists#
pNew->SetDefaultListId( String() );
- // <--
}
pNew->CheckCharFmts( this );
}
else
{
- // --> OD 2008-02-11 #newlistlevelattrs#
pNew = new SwNumRule( GetUniqueNumRuleName( &rName ),
eDefaultNumberFormatPositionAndSpaceMode );
- // <--
}
sal_uInt16 nRet = pNumRuleTbl->Count();
- AddNumRule(pNew); // #i36749#
+ AddNumRule(pNew);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -2614,7 +2320,6 @@ void SwDoc::UpdateNumRule()
rNmTbl[ n ]->Validate();
}
-// --> OD 2008-04-02 #refactorlists#
void SwDoc::MarkListLevel( const String& sListId,
const int nListLevel,
const sal_Bool bValue )
@@ -2634,10 +2339,7 @@ void SwDoc::MarkListLevel( SwList& rList,
// Set new marked list level and notify all affected nodes of the changed mark.
rList.MarkListLevel( nListLevel, bValue );
}
-// <- #i27615#
-// <--
-// #i23726#
sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos)
{
sal_Bool bResult = sal_False;
@@ -2654,7 +2356,6 @@ sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos)
return bResult;
}
-// --> OD 2007-10-26 #i83479#
// implementation for interface <IDocumentListItems>
bool SwDoc::lessThanNodeNum::operator()( const SwNodeNum* pNodeNumOne,
const SwNodeNum* pNodeNumTwo ) const
@@ -2671,7 +2372,7 @@ void SwDoc::addListItem( const SwNodeNum& rNodeNum )
const bool bAlreadyInserted(
mpListItemsList->find( &rNodeNum ) != mpListItemsList->end() );
- ASSERT( !bAlreadyInserted,
+ OSL_ENSURE( !bAlreadyInserted,
"<SwDoc::InsertListItem(..)> - <SwNodeNum> instance already registered as numbered item!" );
if ( !bAlreadyInserted )
{
@@ -2689,8 +2390,7 @@ void SwDoc::removeListItem( const SwNodeNum& rNodeNum )
const tImplSortedNodeNumList::size_type nDeleted = mpListItemsList->erase( &rNodeNum );
if ( nDeleted > 1 )
{
- ASSERT( false,
- "<SwDoc::RemoveListItem(..)> - <SwNodeNum> was registered more than once as numbered item!" );
+ OSL_FAIL( "<SwDoc::RemoveListItem(..)> - <SwNodeNum> was registered more than once as numbered item!" );
}
}
@@ -2734,9 +2434,7 @@ void SwDoc::getNumItems( tSortedNodeNumList& orNodeNumList ) const
}
}
}
-// <--
-// --> OD 2007-11-15 #i83479#
// implementation for interface <IDocumentOutlineNodes>
sal_Int32 SwDoc::getOutlineNodesCount() const
{
@@ -2776,9 +2474,7 @@ void SwDoc::getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOu
GetNodes().GetOutLineNds()[i]->GetTxtNode() );
}
}
-// <--
-// --> OD 2008-03-26 #refactorlists#
// implementation of interface IDocumentListsAccess
SwList* SwDoc::createList( String sListId,
const String sDefaultListStyleName )
@@ -2790,16 +2486,14 @@ SwList* SwDoc::createList( String sListId,
if ( getListByName( sListId ) )
{
- ASSERT( false,
- "<SwDoc::createList(..)> - provided list id already used. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwDoc::createList(..)> - provided list id already used. Serious defect -> please inform OD." );
return 0;
}
SwNumRule* pDefaultNumRuleForNewList = FindNumRulePtr( sDefaultListStyleName );
if ( !pDefaultNumRuleForNewList )
{
- ASSERT( false,
- "<SwDoc::createList(..)> - for provided default list style name no list style is found. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwDoc::createList(..)> - for provided default list style name no list style is found. Serious defect -> please inform OD." );
return 0;
}
@@ -2823,7 +2517,7 @@ SwList* SwDoc::getListByName( const String sListId ) const
{
SwList* pList = 0;
- std::hash_map< String, SwList*, StringHash >::const_iterator
+ boost::unordered_map< String, SwList*, StringHash >::const_iterator
aListIter = maLists.find( sListId );
if ( aListIter != maLists.end() )
{
@@ -2837,23 +2531,20 @@ SwList* SwDoc::createListForListStyle( const String sListStyleName )
{
if ( sListStyleName.Len() == 0 )
{
- ASSERT( false,
- "<SwDoc::createListForListStyle(..)> - no list style name provided. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwDoc::createListForListStyle(..)> - no list style name provided. Serious defect -> please inform OD." );
return 0;
}
if ( getListForListStyle( sListStyleName ) )
{
- ASSERT( false,
- "<SwDoc::createListForListStyle(..)> - a list for the provided list style name already exists. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwDoc::createListForListStyle(..)> - a list for the provided list style name already exists. Serious defect -> please inform OD." );
return 0;
}
SwNumRule* pNumRule = FindNumRulePtr( sListStyleName );
if ( !pNumRule )
{
- ASSERT( false,
- "<SwDoc::createListForListStyle(..)> - for provided list style name no list style is found. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwDoc::createListForListStyle(..)> - for provided list style name no list style is found. Serious defect -> please inform OD." );
return 0;
}
@@ -2873,7 +2564,7 @@ SwList* SwDoc::getListForListStyle( const String sListStyleName ) const
{
SwList* pList = 0;
- std::hash_map< String, SwList*, StringHash >::const_iterator
+ boost::unordered_map< String, SwList*, StringHash >::const_iterator
aListIter = maListStyleLists.find( sListStyleName );
if ( aListIter != maListStyleLists.end() )
{
@@ -2888,7 +2579,7 @@ void SwDoc::deleteListForListStyle( const String sListStyleName )
String sListId;
{
SwList* pList = getListForListStyle( sListStyleName );
- ASSERT( pList,
+ OSL_ENSURE( pList,
"<SwDoc::deleteListForListStyle(..)> - misusage of method: no list found for given list style name" );
if ( pList )
{
@@ -2901,13 +2592,12 @@ void SwDoc::deleteListForListStyle( const String sListStyleName )
deleteList( sListId );
}
}
-// <--
-// --> OD 2008-07-08 #i91400#
+
void SwDoc::trackChangeOfListStyleName( const String sListStyleName,
const String sNewListStyleName )
{
SwList* pList = getListForListStyle( sListStyleName );
- ASSERT( pList,
+ OSL_ENSURE( pList,
"<SwDoc::changeOfListStyleName(..)> - misusage of method: no list found for given list style name" );
if ( pList != 0 )
@@ -2916,9 +2606,7 @@ void SwDoc::trackChangeOfListStyleName( const String sListStyleName,
maListStyleLists[sNewListStyleName] = pList;
}
}
-// <--
-// --> OD 2008-03-13 #refactorlists#
namespace listfunc
{
const String MakeListIdUnique( const SwDoc& rDoc,
@@ -2937,17 +2625,16 @@ namespace listfunc
}
const String CreateUniqueListId( const SwDoc& rDoc )
{
- // --> OD 2008-08-06 #i92478#
+ // #i92478#
String aNewListId = String::CreateFromAscii( "list" );
- // <--
sal_Int64 n = Time().GetTime();
n += Date().GetDate();
n += rand();
- // --> OD 2008-08-06 #i92478#
+ // #i92478#
aNewListId += String::CreateFromInt64( n );
- // <--
return MakeListIdUnique( rDoc, aNewListId );
}
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index b46cf1e101c0..bbd8bc4ee608 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,14 +58,9 @@ using namespace com::sun::star;
TYPEINIT1(SwRedlineHint, SfxHint);
-#ifndef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
- #define _CHECK_REDLINE( pDoc )
- #define _DEBUG_REDLINE( pDoc )
-
-#else
-
-#define _ERROR_PREFIX "redline table corrupted: "
+ #define _ERROR_PREFIX "redline table corrupted: "
// helper function for lcl_CheckRedline
// 1. make sure that pPos->nContent points into pPos->nNode
@@ -154,6 +150,12 @@ TYPEINIT1(SwRedlineHint, SfxHint);
#define _DEBUG_REDLINE( pDoc ) lcl_DebugRedline( pDoc );
+
+#else
+
+ #define _CHECK_REDLINE( pDoc )
+ #define _DEBUG_REDLINE( pDoc )
+
#endif
SV_IMPL_OP_PTRARR_SORT( _SwRedlineTbl, SwRedlinePtr )
@@ -307,10 +309,6 @@ Verhalten von Delete-Redline:
bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
-#if 0
-// #i93179# disabled: ASSERT in ~SwIndexReg #ifdef DBG_UTIL
- SwRedline aCopy( *pNewRedl );
-#endif
bool bError = true;
_CHECK_REDLINE( this )
@@ -384,9 +382,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
for( ; pNewRedl && n < pRedlineTbl->Count(); bDec ? n : ++n )
{
bDec = false;
-#ifdef DVO_TEST
- _CHECK_REDLINE( this )
-#endif
SwRedline* pRedl = (*pRedlineTbl)[ n ];
SwPosition* pRStt = pRedl->Start(),
@@ -452,12 +447,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #107164# own insert-over-insert
- // redlines: just scrap the inside ones
+ // own insert-over-insert redlines:
+ // just scrap the inside ones
pRedlineTbl->Remove( n );
bDec = true;
}
- // <- #107164#
+ // <--
else if( POS_OVERLAP_BEHIND == eCmpPos )
{
*pStt = *pREnd;
@@ -506,8 +501,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #102366# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
// split up the new redline, since it covers the
// existing redline. Insert the first part, and
@@ -525,14 +519,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OVERLAP_BEHIND == eCmpPos )
{
- // #107164# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
pNewRedl->SetStart( *pREnd );
}
else if ( POS_OVERLAP_BEFORE == eCmpPos )
{
- // #107164# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
*pEnd = *pRStt;
if( ( *pStt == *pEnd ) &&
( pNewRedl->GetContentIdx() == NULL ) )
@@ -569,8 +561,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #102366# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
// split up the new redline, since it covers the
// existing redline. Insert the first part, and
@@ -588,13 +579,13 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_EQUAL == eCmpPos )
{
- // #112895# handle identical redlines in broken
- // documents - delete old (delete) redline
+ // handle identical redlines in broken documents
+ // delete old (delete) redline
pRedlineTbl->DeleteAndDestroy( n );
bDec = true;
}
else if ( POS_OVERLAP_BEHIND == eCmpPos )
- { // Another workaround for broken redlines (#107164#)
+ { // Another workaround for broken redlines
pNewRedl->SetStart( *pREnd );
}
break;
@@ -709,7 +700,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_COLLIDE_START:
case POS_COLLIDE_END:
if( pRedl->IsOwnRedline( *pNewRedl ) &&
-// 1 == pRedl->GetStackCount() &&
pRedl->CanCombine( *pNewRedl ) )
{
if( IsHideChanges( eRedlineMode ))
@@ -738,8 +728,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
sal_uInt16 nToBeDeleted = n;
bDec = true;
- // #107359# Do it again, Sam!
- // If you can do it for them, you can do it for me.
if( *(pNewRedl->Start()) <= *pREnd )
{
// Whoooah, we just extended the new 'redline'
@@ -786,7 +774,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
eRedlineMode = (RedlineMode_t)(eRedlineMode | nsRedlineMode_t::REDLINE_IGNOREDELETE_REDLINES);
- // #98863# DeleteAndJoin does not yield the
+ // DeleteAndJoin does not yield the
// desired result if there is no paragraph to
// join with, i.e. at the end of the document.
// For this case, we completely delete the
@@ -1030,14 +1018,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
// insert the pNew part (if it exists)
if( pNew )
{
- // AppendRedline( pNew, bCallDelete );
- //sal_Bool bRet =
pRedlineTbl->Insert( pNew );
// pNew must be deleted if Insert() wasn't
// successful. But that can't happen, since pNew is
// part of the original pRedl redline.
- // ASSERT( bRet, "Can't insert existing redline?" );
+ // OSL_ENSURE( bRet, "Can't insert existing redline?" );
// restart (now with pRedl being split up)
n = 0;
@@ -1567,13 +1553,33 @@ const SwRedline* SwDoc::GetRedline( const SwPosition& rPos,
? *pStt == rPos
: ( *pStt <= rPos && rPos < *pEnd ) )
{
- /* #107318# returned wrong redline ???*/
while( nM && rPos == *(*pRedlineTbl)[ nM - 1 ]->End() &&
rPos == *(*pRedlineTbl)[ nM - 1 ]->Start() )
{
--nM;
pRedl = (*pRedlineTbl)[ nM ];
}
+ // if there are format and insert changes in the same position
+ // show insert change first.
+ // since the redlines are sorted by position, only check the redline
+ // before and after the current redline
+ if( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
+ {
+ if( nM && rPos >= *(*pRedlineTbl)[ nM - 1 ]->Start() &&
+ rPos <= *(*pRedlineTbl)[ nM - 1 ]->End() &&
+ ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM - 1 ]->GetType() ) )
+ {
+ --nM;
+ pRedl = (*pRedlineTbl)[ nM ];
+ }
+ else if( ( nM + 1 ) <= nO && rPos >= *(*pRedlineTbl)[ nM + 1 ]->Start() &&
+ rPos <= *(*pRedlineTbl)[ nM + 1 ]->End() &&
+ ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM + 1 ]->GetType() ) )
+ {
+ ++nM;
+ pRedl = (*pRedlineTbl)[ nM ];
+ }
+ }
if( pFndPos )
*pFndPos = nM;
@@ -1994,13 +2000,12 @@ const SwRedline* lcl_FindCurrRedline( const SwPosition& rSttPos,
return pFnd;
}
-// #111827#
int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
SwRedlineTbl& rArr, sal_Bool bCallDelete,
const SwPaM& rPam)
{
sal_uInt16 n = 0;
- int nCount = 0; // #111827#
+ int nCount = 0;
const SwPosition* pStt = rPam.Start(),
* pEnd = pStt == rPam.GetPoint() ? rPam.GetMark()
@@ -2011,7 +2016,7 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
{
// dann nur die TeilSelektion aufheben
if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
- nCount++; // #111827#
+ nCount++;
++n;
}
@@ -2023,7 +2028,7 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
if( *pTmp->End() <= *pEnd )
{
if( (*fn_AcceptReject)( rArr, n, bCallDelete, 0, 0 ))
- nCount++; // #111827#
+ nCount++;
}
else
{
@@ -2031,13 +2036,13 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
{
// dann nur in der TeilSelektion aufheben
if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
- nCount++; // #111827#
+ nCount++;
}
break;
}
}
}
- return nCount; // #111827#
+ return nCount;
}
void lcl_AdjustRedlineRange( SwPaM& rPam )
@@ -2091,7 +2096,6 @@ bool SwDoc::AcceptRedline( sal_uInt16 nPos, bool bCallDelete )
{
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
@@ -2163,7 +2167,6 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
GetIDocumentUndoRedo().AppendUndo( new SwUndoAcceptRedline( aPam ));
}
- // #111827#
int nRet = lcl_AcceptRejectRedl( lcl_AcceptRedline, *pRedlineTbl,
bCallDelete, aPam );
if( nRet > 0 )
@@ -2173,7 +2176,6 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
}
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
String aTmpStr;
{
@@ -2204,7 +2206,6 @@ bool SwDoc::RejectRedline( sal_uInt16 nPos, bool bCallDelete )
{
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
@@ -2276,7 +2277,6 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
GetIDocumentUndoRedo().AppendUndo( new SwUndoRejectRedline(aPam) );
}
- // #111827#
int nRet = lcl_AcceptRejectRedl( lcl_RejectRedline, *pRedlineTbl,
bCallDelete, aPam );
if( nRet > 0 )
@@ -2286,7 +2286,6 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
}
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
String aTmpStr;
{
@@ -2631,7 +2630,7 @@ sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_Bool bIns )
bRet = InsertWithValidRanges( p );
else
{
- ASSERT( !this, "Redline: falscher Bereich" );
+ OSL_ENSURE( !this, "Redline: falscher Bereich" );
}
return bRet;
}
@@ -2648,7 +2647,7 @@ sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_uInt16& rP, sal_Bool bIns )
bRet = InsertWithValidRanges( p, &rP );
else
{
- ASSERT( !this, "Redline: falscher Bereich" );
+ OSL_ENSURE( !this, "Redline: falscher Bereich" );
}
return bRet;
}
@@ -3008,8 +3007,6 @@ int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) co
return nRet;
}
-/* */
-
SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut )
: pNext( 0 ), pExtraData( 0 ), eType( eT ), nAuthor( nAut ), nSeqNo( 0 )
{
@@ -3052,7 +3049,6 @@ void SwRedlineData::SetExtraData( const SwRedlineExtraData* pData )
pExtraData = 0;
}
-// #111827#
String SwRedlineData::GetDescr() const
{
String aResult;
@@ -3062,8 +3058,6 @@ String SwRedlineData::GetDescr() const
return aResult;
}
-/* */
-
SwRedline::SwRedline(RedlineType_t eTyp, const SwPaM& rPam )
: SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
pRedlineData( new SwRedlineData( eTyp, GetDoc()->GetRedlineAuthor() ) ),
@@ -3125,9 +3119,8 @@ sal_Bool SwRedline::HasValidRange() const
* pMkNd = &GetMark()->nNode.GetNode();
if( pPtNd->StartOfSectionNode() == pMkNd->StartOfSectionNode() &&
!pPtNd->StartOfSectionNode()->IsTableNode() &&
- // JP 18.5.2001: Bug 87222 - invalid if points on the end of content
- // DVO 25.03.2002: #96530# end-of-content only invalid if no content
- // index exists
+ // invalid if points on the end of content
+ // end-of-content only invalid if no content index exists
( pPtNd != pMkNd || GetContentIdx() != NULL ||
pPtNd != &pPtNd->GetNodes().GetEndOfContent() )
)
@@ -3305,7 +3298,7 @@ void SwRedline::CalcStartEnd( sal_uLong nNdIdx, sal_uInt16& nStart, sal_uInt16&
}
else
{
- ASSERT( pREnd->nNode == nNdIdx,
+ OSL_ENSURE( pREnd->nNode == nNdIdx,
"SwRedlineItr::Seek: GetRedlinePos Error" );
nStart = 0; // Absatz wird vorne ueberlappt
nEnd = pREnd->nContent.GetIndex();
@@ -3418,11 +3411,11 @@ void SwRedline::CopyToSection()
bSaveRdlMoveFlg = pDoc->IsRedlineMove();
pDoc->SetCopyIsMove( sal_True );
- // #100619# The IsRedlineMove() flag causes the behaviour of the
+ // The IsRedlineMove() flag causes the behaviour of the
// SwDoc::_CopyFlyInFly method to change, which will eventually be
// called by the pDoc->Copy line below (through SwDoc::_Copy,
- // SwDoc::CopyWithFlyInFly). This rather obscure bugfix was introduced
- // for #63198# and #64896#, and apparently never really worked.
+ // SwDoc::CopyWithFlyInFly). This rather obscure bugfix
+ // apparently never really worked.
pDoc->SetRedlineMove( pStt->nContent == 0 );
if( pCSttNd )
@@ -3440,7 +3433,7 @@ void SwRedline::CopyToSection()
SwPosition aPos( aNdIdx, SwIndex( pTxtNd ));
pDoc->CopyRange( *this, aPos, false );
- // JP 08.10.98: die Vorlage vom EndNode ggfs. mit uebernehmen
+ // die Vorlage vom EndNode ggfs. mit uebernehmen
// - ist im Doc::Copy nicht erwuenscht
if( pCEndNd && pCEndNd != pCSttNd )
{
@@ -3508,10 +3501,8 @@ void SwRedline::DelCopyOfSection()
if( pCSttNd && pCEndNd )
{
- // --> OD 2009-08-20 #i100466#
- // force a <join next> on <delete and join> operation
+ // #i100466# - force a <join next> on <delete and join> operation
pDoc->DeleteAndJoin( aPam, true );
- // <--
}
else if( pCSttNd || pCEndNd )
{
@@ -3521,7 +3512,7 @@ void SwRedline::DelCopyOfSection()
if( bDelLastPara )
{
- // #100611# To prevent dangling references to the paragraph to
+ // To prevent dangling references to the paragraph to
// be deleted, redline that point into this paragraph should be
// moved to the new end position. Since redlines in the redline
// table are sorted and the pEnd position is an endnode (see
@@ -3529,7 +3520,7 @@ void SwRedline::DelCopyOfSection()
// current ones can be affected.
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
sal_uInt16 n = rTbl.GetPos( this );
- ASSERT( n != USHRT_MAX, "How strange. We don't exist!" );
+ OSL_ENSURE( n != USHRT_MAX, "How strange. We don't exist!" );
for( sal_Bool bBreak = sal_False; !bBreak && n > 0; )
{
--n;
@@ -3577,7 +3568,7 @@ void SwRedline::MoveFromSection()
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
SvPtrarr aBeforeArr( 16, 16 ), aBehindArr( 16, 16 );
sal_uInt16 nMyPos = rTbl.GetPos( this );
- ASSERT( this, "this nicht im Array?" );
+ OSL_ENSURE( this, "this nicht im Array?" );
sal_Bool bBreak = sal_False;
sal_uInt16 n;
@@ -3615,9 +3606,7 @@ void SwRedline::MoveFromSection()
}
}
- // --> OD 2009-03-17 #i95711#
- const SwNode* pKeptCntntSectNode( &pCntntSect->GetNode() );
- // <--
+ const SwNode* pKeptCntntSectNode( &pCntntSect->GetNode() ); // #i95711#
{
SwPaM aPam( pCntntSect->GetNode(),
*pCntntSect->GetNode().EndOfSectionNode(), 1,
@@ -3666,7 +3655,7 @@ void SwRedline::MoveFromSection()
if( pColl && pCNd )
pCNd->ChgFmtColl( pColl );
}
- // --> OD 2009-03-17 #i95771#
+ // #i95771#
// Under certain conditions the previous <SwDoc::Move(..)> has already
// remove the change tracking section of this <SwRedline> instance from
// the change tracking nodes area.
@@ -3681,7 +3670,7 @@ void SwRedline::MoveFromSection()
// <--
delete pCntntSect, pCntntSect = 0;
- // #100611# adjustment of redline table positions must take start and
+ // adjustment of redline table positions must take start and
// end into account, not point and mark.
for( n = 0; n < aBeforeArr.Count(); ++n )
*(SwPosition*)aBeforeArr[ n ] = *Start();
@@ -3705,9 +3694,9 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx )
delete pCntntSect, pCntntSect = 0;
bIsVisible = sal_False;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !this, "das ist keine gueltige Operation" );
+ OSL_ENSURE( !this, "das ist keine gueltige Operation" );
#endif
}
@@ -3719,8 +3708,6 @@ sal_Bool SwRedline::CanCombine( const SwRedline& rRedl ) const
void SwRedline::PushData( const SwRedline& rRedl, sal_Bool bOwnAsNext )
{
-// SwRedlineData* pNew = new SwRedlineData( rRedl.GetType(),
-// rRedl.GetAuthor() );
SwRedlineData* pNew = new SwRedlineData( *rRedl.pRedlineData, sal_False );
if( bOwnAsNext )
{
@@ -3753,7 +3740,6 @@ sal_uInt16 SwRedline::GetStackCount() const
return nRet;
}
-// -> #111827#
sal_uInt16 SwRedline::GetAuthor( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).nAuthor;
@@ -3778,7 +3764,6 @@ const String& SwRedline::GetComment( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).sComment;
}
-// <- #111827#
int SwRedline::operator==( const SwRedline& rCmp ) const
{
@@ -3798,7 +3783,6 @@ int SwRedline::operator<( const SwRedline& rCmp ) const
return nResult;
}
-// -> #111827#
const SwRedlineData & SwRedline::GetRedlineData(sal_uInt16 nPos) const
{
SwRedlineData * pCur = pRedlineData;
@@ -3810,7 +3794,7 @@ const SwRedlineData & SwRedline::GetRedlineData(sal_uInt16 nPos) const
nPos--;
}
- ASSERT( 0 == nPos, "Pos angabe ist zu gross" );
+ OSL_ENSURE( 0 == nPos, "Pos angabe ist zu gross" );
return *pCur;
}
@@ -3854,7 +3838,6 @@ String SwRedline::GetDescr(sal_uInt16 nPos)
return aResult;
}
-// <- #111827#
bool SwDoc::IsInRedlines(const SwNode & rNode) const
@@ -3866,3 +3849,5 @@ bool SwDoc::IsInRedlines(const SwNode & rNode) const
return aPam.ContainsPosition(aPos) ? true : false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index c8703ab6adcb..564e8d7e6989 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -298,28 +299,7 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_
case UnicodeType::OTHER_LETTER:
bChkNxtWrd = sal_True;
- // no break!
-// case UnicodeType::UNASSIGNED:
-// case UnicodeType::MODIFIER_LETTER:
-// case UnicodeType::NON_SPACING_MARK:
-// case UnicodeType::ENCLOSING_MARK:
-// case UnicodeType::COMBINING_SPACING_MARK:
-// case UnicodeType::LETTER_NUMBER:
-// case UnicodeType::OTHER_NUMBER:
-// case UnicodeType::LINE_SEPARATOR:
-// case UnicodeType::PARAGRAPH_SEPARATOR:
-// case UnicodeType::FORMAT:
-// case UnicodeType::SURROGATE:
-// case UnicodeType::DASH_PUNCTUATION:
-// case UnicodeType::CONNECTOR_PUNCTUATION:
-///*?? */case UnicodeType::OTHER_PUNCTUATION:
-//--> char '!' is to ignore!
-// case UnicodeType::MATH_SYMBOL:
-// case UnicodeType::CURRENCY_SYMBOL:
-// case UnicodeType::MODIFIER_SYMBOL:
-// case UnicodeType::OTHER_SYMBOL:
-// case UnicodeType::INITIAL_PUNCTUATION:
-// case UnicodeType::FINAL_PUNCTUATION:
+
default:
bIsAlphaNum = sal_False;
break;
@@ -359,3 +339,5 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_
SwRubyListEntry::~SwRubyListEntry()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 497e00b70125..62b9560151c6 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,11 +58,6 @@
#include <node2lay.hxx>
#include <unochart.hxx>
-#if OSL_DEBUG_LEVEL > 1
-//nur zum debugen
-#include <cellatr.hxx>
-#endif
-
using namespace ::com::sun::star::lang;
SwSortOptions* SwSortElement::pOptions = 0;
@@ -74,16 +70,13 @@ LocaleDataWrapper* SwSortElement::pLclData = 0;
SV_IMPL_OP_PTRARR_SORT( SwSortElements, SwSortElementPtr );
-
/*--------------------------------------------------------------------
Beschreibung: Ein Sortierelement fuers Sort konstruieren
--------------------------------------------------------------------*/
-
-
void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
FlatFndBox* pFltBx )
{
- ASSERT( !pDoc && !pOptions && !pBox, "wer hat das Finit vergessen?" );
+ OSL_ENSURE( !pDoc && !pOptions && !pBox, "wer hat das Finit vergessen?" );
pDoc = pD;
pOptions = new SwSortOptions( rOpt );
pBox = pFltBx;
@@ -100,11 +93,8 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
pSortCollator = new CollatorWrapper(
::comphelper::getProcessServiceFactory() );
-// pSortCollator->loadCollatorAlgorithm( sAlgorithm, aLocale,
-// rOpt.bIgnoreCase ? SW_COLLATOR_IGNORES : 0 );
}
-
void SwSortElement::Finit()
{
delete pOptions, pOptions = 0;
@@ -116,12 +106,10 @@ void SwSortElement::Finit()
pBox = 0;
}
-
SwSortElement::~SwSortElement()
{
}
-
double SwSortElement::StrToDouble( const String& rStr ) const
{
if( !pLclData )
@@ -143,8 +131,6 @@ double SwSortElement::StrToDouble( const String& rStr ) const
/*--------------------------------------------------------------------
Beschreibung: Operatoren zum Vergleichen
--------------------------------------------------------------------*/
-
-
sal_Bool SwSortElement::operator==(const SwSortElement& )
{
return sal_False;
@@ -153,7 +139,6 @@ sal_Bool SwSortElement::operator==(const SwSortElement& )
/*--------------------------------------------------------------------
Beschreibung: Kleiner-Operator fuers sortieren
--------------------------------------------------------------------*/
-
sal_Bool SwSortElement::operator<(const SwSortElement& rCmp)
{
@@ -211,24 +196,18 @@ double SwSortElement::GetValue( sal_uInt16 nKey ) const
/*--------------------------------------------------------------------
Beschreibung: SortierElemente fuer Text
--------------------------------------------------------------------*/
-
-
SwSortTxtElement::SwSortTxtElement(const SwNodeIndex& rPos)
: nOrg(rPos.GetIndex()), aPos(rPos)
{
}
-
SwSortTxtElement::~SwSortTxtElement()
{
}
-
/*--------------------------------------------------------------------
Beschreibung: Key ermitteln
--------------------------------------------------------------------*/
-
-
String SwSortTxtElement::GetKey(sal_uInt16 nId) const
{
SwTxtNode* pTxtNd = aPos.GetNode().GetTxtNode();
@@ -255,17 +234,14 @@ String SwSortTxtElement::GetKey(sal_uInt16 nId) const
return rStr.Copy( nStart, nEnd-nStart );
}
-
/*--------------------------------------------------------------------
Beschreibung: Sortier-Elemente fuer Tabellen
--------------------------------------------------------------------*/
-
SwSortBoxElement::SwSortBoxElement( sal_uInt16 nRC )
: nRow( nRC )
{
}
-
SwSortBoxElement::~SwSortBoxElement()
{
}
@@ -273,8 +249,6 @@ SwSortBoxElement::~SwSortBoxElement()
/*--------------------------------------------------------------------
Beschreibung: Schluessel zu einer Zelle ermitteln
--------------------------------------------------------------------*/
-
-
String SwSortBoxElement::GetKey(sal_uInt16 nKey) const
{
const _FndBox* pFndBox;
@@ -290,7 +264,7 @@ String SwSortBoxElement::GetKey(sal_uInt16 nKey) const
if( pFndBox )
{ // StartNode holen und ueberlesen
const SwTableBox* pMyBox = pFndBox->GetBox();
- ASSERT(pMyBox, "Keine atomare Box");
+ OSL_ENSURE(pMyBox, "Keine atomare Box");
if( pMyBox->GetSttNd() )
{
@@ -332,8 +306,6 @@ double SwSortBoxElement::GetValue( sal_uInt16 nKey ) const
/*--------------------------------------------------------------------
Beschreibung: Text sortieren im Document
--------------------------------------------------------------------*/
-
-
sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
{
// pruefen ob Rahmen im Text
@@ -519,11 +491,10 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
/*--------------------------------------------------------------------
Beschreibung: Tabelle sortieren im Document
--------------------------------------------------------------------*/
-
sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
{
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -649,8 +620,6 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
/*--------------------------------------------------------------------
Beschreibung: Zeilenweise verschieben
--------------------------------------------------------------------*/
-
-
void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
@@ -697,8 +666,6 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
/*--------------------------------------------------------------------
Beschreibung: Spaltenweise verschieben
--------------------------------------------------------------------*/
-
-
void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
@@ -745,12 +712,10 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
/*--------------------------------------------------------------------
Beschreibung: Eine einzelne Zelle verschieben
--------------------------------------------------------------------*/
-
-
void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
sal_Bool bMovedBefore, SwUndoSort* pUD)
{
- ASSERT(pSource && pTar,"Fehlende Quelle oder Ziel");
+ OSL_ENSURE(pSource && pTar,"Fehlende Quelle oder Ziel");
if(pSource == pTar)
return;
@@ -780,7 +745,7 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
sal_Bool bDelFirst = sal_False;
if( nCount == 2 )
{
- ASSERT( pNd->GetCntntNode(), "Kein ContentNode");
+ OSL_ENSURE( pNd->GetCntntNode(), "Kein ContentNode");
bDelFirst = !pNd->GetCntntNode()->Len() && bMovedBefore;
}
@@ -803,8 +768,6 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
/*--------------------------------------------------------------------
Beschreibung: Zweidimensionales Array aus FndBoxes generieren
--------------------------------------------------------------------*/
-
-
FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
pDoc(pDocPtr),
rBoxRef(rBox),
@@ -829,7 +792,6 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
}
}
-
FlatFndBox::~FlatFndBox()
{
_FndBox** ppTmp = (_FndBox**)pArr;
@@ -842,8 +804,6 @@ FlatFndBox::~FlatFndBox()
/*--------------------------------------------------------------------
Beschreibung: Alle Lines einer Box muessen gleichviel Boxen haben
--------------------------------------------------------------------*/
-
-
sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
{
const _FndLines &rLines = rBox.GetLines();
@@ -870,8 +830,6 @@ sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
Beschreibung: Box auf Symmetrie pruefen
Alle Boxen einer Line muessen gleichviele Lines haben
--------------------------------------------------------------------*/
-
-
sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
{
const _FndBoxes &rBoxes = rLn.GetBoxes();
@@ -897,8 +855,6 @@ sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
/*--------------------------------------------------------------------
Beschreibung: max Anzahl der Spalten (Boxes)
--------------------------------------------------------------------*/
-
-
sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
@@ -926,8 +882,6 @@ sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
/*--------------------------------------------------------------------
Beschreibung: max Anzahl der Zeilen (Lines)
--------------------------------------------------------------------*/
-
-
sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
@@ -952,8 +906,6 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
/*--------------------------------------------------------------------
Beschreibung: lineares Array aus atomaren FndBoxes erzeugen
--------------------------------------------------------------------*/
-
-
void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox)
{
sal_Bool bModRow = sal_False;
@@ -1015,22 +967,20 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox)
/*--------------------------------------------------------------------
Beschreibung: Zugriff auf eine bestimmte Zelle
--------------------------------------------------------------------*/
-
-
const _FndBox* FlatFndBox::GetBox(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
sal_uInt16 nOff = n_Row * nCols + n_Col;
const _FndBox* pTmp = *(pArr + nOff);
- ASSERT(n_Col < nCols && n_Row < nRows && pTmp, "unzulaessiger Array-Zugriff");
+ OSL_ENSURE(n_Col < nCols && n_Row < nRows && pTmp, "unzulaessiger Array-Zugriff");
return pTmp;
}
const SfxItemSet* FlatFndBox::GetItemSet(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
- ASSERT( !ppItemSets || ( n_Col < nCols && n_Row < nRows), "unzulaessiger Array-Zugriff");
+ OSL_ENSURE( !ppItemSets || ( n_Col < nCols && n_Row < nRows), "unzulaessiger Array-Zugriff");
return ppItemSets ? *(ppItemSets + (n_Row * nCols + n_Col )) : 0;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx
index ee44bf142de3..0b79d817a436 100644
--- a/sw/source/core/doc/docstat.cxx
+++ b/sw/source/core/doc/docstat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,7 @@ SwDocStat::SwDocStat() :
nAllPara(1),
nWord(0),
nChar(0),
+ nCharExcludingSpaces(0),
bModified(sal_True)
{}
@@ -62,6 +64,8 @@ void SwDocStat::Reset()
nAllPara= 1;
nWord = 0;
nChar = 0;
+ nCharExcludingSpaces = 0;
bModified = sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index ce17a146d40f..870265cb288d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,7 +83,7 @@ using namespace ::com::sun::star;
const sal_Unicode cNumRepl = '@';
const sal_Unicode cEndPageNum = '~';
-const sal_Char __FAR_DATA sPageDeli[] = ", ";
+const sal_Char sPageDeli[] = ", ";
SV_IMPL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr)
@@ -137,8 +138,6 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
/*--------------------------------------------------------------------
Beschreibung: aktuelle Verzeichnismarkierungen ermitteln
--------------------------------------------------------------------*/
-
-
sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
SwTOXMarks& rArr ) const
{
@@ -179,15 +178,14 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
/*--------------------------------------------------------------------
Beschreibung: Marke loeschen
--------------------------------------------------------------------*/
-
void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
{
// hole den TextNode und
const SwTxtTOXMark* pTxtTOXMark = pTOXMark->GetTxtTOXMark();
- ASSERT( pTxtTOXMark, "Kein TxtTOXMark, kann nicht geloescht werden" );
+ OSL_ENSURE( pTxtTOXMark, "Kein TxtTOXMark, kann nicht geloescht werden" );
SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode());
- ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
+ OSL_ENSURE( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -214,7 +212,6 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
/*--------------------------------------------------------------------
Beschreibung: Traveln zwischen TOXMarks
--------------------------------------------------------------------*/
-
class CompareNodeCntnt
{
sal_uLong nNode;
@@ -223,20 +220,20 @@ public:
CompareNodeCntnt( sal_uLong nNd, xub_StrLen nCnt )
: nNode( nNd ), nCntnt( nCnt ) {}
- int operator==( const CompareNodeCntnt& rCmp )
+ int operator==( const CompareNodeCntnt& rCmp ) const
{ return nNode == rCmp.nNode && nCntnt == rCmp.nCntnt; }
- int operator!=( const CompareNodeCntnt& rCmp )
+ int operator!=( const CompareNodeCntnt& rCmp ) const
{ return nNode != rCmp.nNode || nCntnt != rCmp.nCntnt; }
- int operator< ( const CompareNodeCntnt& rCmp )
+ int operator< ( const CompareNodeCntnt& rCmp ) const
{ return nNode < rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt < rCmp.nCntnt); }
- int operator<=( const CompareNodeCntnt& rCmp )
+ int operator<=( const CompareNodeCntnt& rCmp ) const
{ return nNode < rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt <= rCmp.nCntnt); }
- int operator> ( const CompareNodeCntnt& rCmp )
+ int operator> ( const CompareNodeCntnt& rCmp ) const
{ return nNode > rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt > rCmp.nCntnt); }
- int operator>=( const CompareNodeCntnt& rCmp )
+ int operator>=( const CompareNodeCntnt& rCmp ) const
{ return nNode > rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt >= rCmp.nCntnt); }
};
@@ -245,7 +242,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
SwTOXSearch eDir, sal_Bool bInReadOnly )
{
const SwTxtTOXMark* pMark = rCurTOXMark.GetTxtTOXMark();
- ASSERT(pMark, "pMark==0 Ungueltige TxtTOXMark");
+ OSL_ENSURE(pMark, "pMark==0 Ungueltige TxtTOXMark");
const SwTxtNode *pTOXSrc = pMark->GetpTxtNd();
@@ -358,7 +355,6 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
return *pNew;
}
-
const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SwTOXBase& rTOX,
const SfxItemSet* pSet,
@@ -379,7 +375,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
if( bExpand )
{
- // OD 19.03.2003 #106329# - add value for 2nd parameter = true to
+ // add value for 2nd parameter = true to
// indicate, that a creation of a new table of content has to be performed.
// Value of 1st parameter = default value.
pNewSection->Update( 0, true );
@@ -411,8 +407,6 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
return pNewSection;
}
-
-
const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
const SwTOXBase& rTOX,
const SfxItemSet* pSet )
@@ -457,7 +451,6 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd
/*--------------------------------------------------------------------
Beschreibung: Aktuelles Verzeichnis ermitteln
--------------------------------------------------------------------*/
-
const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
{
const SwNode& rNd = rPos.nNode.GetNode();
@@ -467,7 +460,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
SectionType eT = pSectNd->GetSection().GetType();
if( TOX_CONTENT_SECTION == eT )
{
- ASSERT( pSectNd->GetSection().ISA( SwTOXBaseSection ),
+ OSL_ENSURE( pSectNd->GetSection().ISA( SwTOXBaseSection ),
"keine TOXBaseSection!" );
SwTOXBaseSection& rTOXSect = (SwTOXBaseSection&)
pSectNd->GetSection();
@@ -480,10 +473,10 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
- ASSERT( pFmt, "invalid TOXBaseSection!" );
+ OSL_ENSURE( pFmt, "invalid TOXBaseSection!" );
return pFmt->GetAttrSet();
}
@@ -530,13 +523,11 @@ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
/*--------------------------------------------------------------------
Beschreibung: Verzeichnis loeschen
--------------------------------------------------------------------*/
-
-
sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
{
// its only delete the TOX, not the nodes
sal_Bool bRet = sal_False;
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
@@ -624,7 +615,6 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
/*--------------------------------------------------------------------
Beschreibung: Verzeichnistypen verwalten
--------------------------------------------------------------------*/
-
sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
@@ -645,7 +635,6 @@ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
return 0;
}
-
const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp )
{
SwTOXType * pNew = new SwTOXType( rTyp );
@@ -709,7 +698,7 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ),
"keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase;
@@ -724,7 +713,6 @@ sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
return bRet;
}
-
const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
const SwNode* pNd = &rNd;
@@ -739,17 +727,15 @@ const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
SwPosition aPos( *pNd );
pNd = GetBodyTxtNode( *pNd->GetDoc(), aPos, *pFrm );
- ASSERT( pNd, "wo steht der Absatz" );
+ OSL_ENSURE( pNd, "wo steht der Absatz" );
}
}
return pNd ? pNd->FindOutlineNodeOfLevel( nLvl ) : 0;
}
-
/*--------------------------------------------------------------------
Beschreibung: Verzeichnis-Klasse
--------------------------------------------------------------------*/
-
SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt)
: SwTOXBase( rBase )
, SwSection( TOX_CONTENT_SECTION, aEmptyStr, rFmt )
@@ -758,12 +744,10 @@ SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt)
SetSectionName( GetTOXName() );
}
-
SwTOXBaseSection::~SwTOXBaseSection()
{
}
-
sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart ) const
{
sal_Bool bRet = sal_False;
@@ -792,7 +776,6 @@ sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt zusammensammeln
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
const bool _bNewTOX )//swmodtest 080307
{
@@ -810,8 +793,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
if(pAttr && pDoc && GetFmt())
pDoc->ChgFmt(*GetFmt(), *pAttr);
- // OD 18.03.2003 #106329# - determine default page description, which
- // will be used by the content nodes, if no approriate one is found.
+ // determine default page description, which will be used by the content nodes,
+ // if no approriate one is found.
const SwPageDesc* pDefaultPageDesc;
{
pDefaultPageDesc =
@@ -827,8 +810,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
pDefaultPageDesc = 0;
}
}
- // OD 28.04.2003 #109166# - consider end node of content section in the
- // node array.
+ // consider end node of content section in the node array.
if ( !pDefaultPageDesc &&
( pSectNd->EndOfSectionNode()->GetIndex() <
(pSectNd->GetNodes().GetEndOfContent().GetIndex() - 1) )
@@ -846,8 +828,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
pDefaultPageDesc = pNdAfterTOX->FindPageDesc( sal_False );
}
}
- // OD 28.04.2003 #109166# - consider start node of content section in
- // the node array.
+ // consider start node of content section in the node array.
if ( !pDefaultPageDesc &&
( pSectNd->GetIndex() >
(pSectNd->GetNodes().GetEndOfContent().StartOfSectionIndex() + 1) )
@@ -1038,8 +1019,8 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
pNextMark->GetSecondaryKey() == sSecKey)
nRange++;
}
- // OD 18.03.2003 #106329# - pass node index of table-of-content section
- // and default page description to method <GenerateText(..)>.
+ // pass node index of table-of-content section and default page description
+ // to method <GenerateText(..)>.
GenerateText( nCnt, nRange, aStrArr, pSectNd->GetIndex(), pDefaultPageDesc );
nCnt += nRange - 1;
}
@@ -1086,8 +1067,6 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
/*--------------------------------------------------------------------
Beschreibung: AlphaDelimitter einfuegen
--------------------------------------------------------------------*/
-
-
void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1132,7 +1111,6 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
/*--------------------------------------------------------------------
Beschreibung: Template auswerten
--------------------------------------------------------------------*/
-
SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1180,11 +1158,9 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
return pColl;
}
-
/*--------------------------------------------------------------------
Beschreibung: Aus Markierungen erzeugen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
const SwTxtNode* pOwnChapterNode )
{
@@ -1257,12 +1233,9 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
}
}
-
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt aus Gliederungsebene generieren
--------------------------------------------------------------------*/
-
-
void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1274,8 +1247,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
::SetProgressState( 0, pDoc->GetDocShell() );
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
- //sal_uInt16(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
- sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
+ sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() &&
pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
@@ -1291,7 +1263,6 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt aus Vorlagenbereichen generieren
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1308,8 +1279,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
if( !pColl ||
( TOX_CONTENT == SwTOXBase::GetType() &&
GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL &&
- //NO_NUMBERING != pColl->GetOutlineLevel() ) )//#outline level,zhaojianwei
- pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei
+ pColl->IsAssignedToListLevelOfOutlineStyle()) )
continue;
SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl );
@@ -1330,7 +1300,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
}
}
-/* -----------------14.07.99 09:59-------------------
+/* --------------------------------------------------
Description: generate content from sequence fields
--------------------------------------------------*/
void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
@@ -1387,11 +1357,8 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
::SetProgressState( 0, pDoc->GetDocShell() );
-// const SwTxtNode* pChapterCompareNode = 0;
-
if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
- rTxtNode.GetNodes().IsDocNodes() /*&&
- (!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */)
+ rTxtNode.GetNodes().IsDocNodes() )
{
//#106485# the body node has to be used!
SwCntntFrm *pFrm = rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() );
@@ -1508,7 +1475,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
}
else
{
- DBG_ERROR("OLE-object nicht geladen?");
+ OSL_FAIL("OLE-object nicht geladen?");
bInclude = sal_False;
}
}
@@ -1535,9 +1502,6 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
MAXLEVEL - 1 );
if( pOutlNd )
{
- //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nTmp < NO_NUMBERING )
- // nSetLevel = nTmp + 1;
if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
nSetLevel = pOutlNd->GetTxtColl()->GetAttrOutlineLevel() ;//<-end,zhaojianwei
}
@@ -1561,7 +1525,6 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
/*--------------------------------------------------------------------
Beschreibung: Tabelleneintraege zusammensuchen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1594,9 +1557,6 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
if( pOutlNd )
{
- //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nTmp < NO_NUMBERING )
- // pNew->SetLevel( nTmp + 1 );
if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
{
const int nTmp = pOutlNd->GetTxtColl()->GetAttrOutlineLevel();
@@ -1616,7 +1576,6 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
Beschreibung: String generieren anhand der Form
SonderZeichen 0-31 und 255 entfernen
--------------------------------------------------------------------*/
-
String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal_uInt8 nLevel )
{
String sRet;
@@ -1635,8 +1594,8 @@ String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal
return sRet;
}
-// OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
-// in order to control, which page description is used, no appropriate one is found.
+// add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc> in order to control,
+// which page description is used, no appropriate one is found.
void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
sal_uInt16 nCount,
SvStringsDtor& ,
@@ -1658,7 +1617,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
// String mit dem Pattern aus der Form initialisieren
const SwTOXSortTabBase& rBase = *aSortArr[nIndex];
sal_uInt16 nLvl = rBase.GetLevel();
- ASSERT( nLvl < GetTOXForm().GetFormMax(), "ungueltiges FORM_LEVEL");
+ OSL_ENSURE( nLvl < GetTOXForm().GetFormMax(), "ungueltiges FORM_LEVEL");
SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
xub_StrLen nLinkStartPosition = STRING_NOTFOUND;
@@ -1740,7 +1699,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
{
// dann hilft alles nichts, wir muessen ueber die Seiten-
// vorlage gehen.
- // OD 18.03.2003 #106329# - call
sal_uInt32 nPgDescNdIdx = pTOXNd->GetIndex() + 1;
sal_uInt32* pPgDescNdIdx = &nPgDescNdIdx;
pPageDesc = pTOXNd->FindPageDesc( sal_False, pPgDescNdIdx );
@@ -1797,9 +1755,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
aInsStr += cEndPageNum;
rTxt.Append( aInsStr );
}
-// // Tab entfernen, wenn keine Seitennummer
-// else if( rTxt.Len() && '\t' == rTxt.GetChar( rTxt.Len() - 1 ))
-// rTxt.Erase( rTxt.Len()-1, 1 );
}
break;
@@ -1810,12 +1765,9 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
if(rBase.aTOXSources.Count())
pTOXSource = &rBase.aTOXSources[0];
- // --> OD 2008-02-14 #i53420#
-// if( pTOXSource && pTOXSource->pNd
-// pTOXSource->pNd->IsTxtNode() )
+ // #i53420#
if ( pTOXSource && pTOXSource->pNd &&
pTOXSource->pNd->IsCntntNode() )
- // <--
{
const SwCntntFrm* pFrm = pTOXSource->pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
@@ -1823,14 +1775,13 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
SwChapterFieldType aFldTyp;
SwChapterField aFld( &aFldTyp, aToken.nChapterFormat );
aFld.SetLevel( static_cast<sal_uInt8>(aToken.nOutlineLevel - 1) );
- // --> OD 2008-02-14 #i53420#
-// aFld.ChangeExpansion( pFrm, (SwTxtNode*)pTOXSource->pNd, sal_True );
+ // #i53420#
aFld.ChangeExpansion( pFrm,
dynamic_cast<const SwCntntNode*>(pTOXSource->pNd),
sal_True );
// <--
- //---> i89791
- // OD 2008-06-26 - continue to support CF_NUMBER
+ //---> #i89791#
+ // continue to support CF_NUMBER
// and CF_NUM_TITLE in order to handle ODF 1.0/1.1
// written by OOo 3.x in the same way as OOo 2.x
// would handle them.
@@ -1919,7 +1870,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
}
}
- aIt++; // #i21237#
+ ++aIt; // #i21237#
}
pTOXNd->SetAttr( aTStops );
@@ -1938,7 +1889,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
Beschreibung: Seitennummer errechnen und nach dem Formatieren
eintragen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdatePageNum()
{
if( !aSortArr.Count() )
@@ -1993,7 +1943,7 @@ void SwTOXBaseSection::UpdatePageNum()
if( rTOXSource.pNd )
{
SwCntntFrm* pFrm = rTOXSource.pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
- ASSERT( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
+ OSL_ENSURE( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
if( !pFrm )
continue;
if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->HasFollow() )
@@ -2036,7 +1986,7 @@ void SwTOXBaseSection::UpdatePageNum()
if(pBase->pTOXNd)
{
const SwTxtNode* pTxtNd = pBase->pTOXNd->GetTxtNode();
- ASSERT( pTxtNd, "kein TextNode, falsches Verzeichnis" );
+ OSL_ENSURE( pTxtNd, "kein TextNode, falsches Verzeichnis" );
_UpdatePageNum( (SwTxtNode*)pTxtNd, aNums, aDescs, pMainNums,
aIntl );
@@ -2050,11 +2000,9 @@ void SwTOXBaseSection::UpdatePageNum()
aSortArr.DeleteAndDestroy( 0, aSortArr.Count() );
}
-
/*--------------------------------------------------------------------
Beschreibung: Austausch der Seitennummer-Platzhalter
--------------------------------------------------------------------*/
-
// search for the page no in the array of main entry page numbers
sal_Bool lcl_HasMainEntry( const SvUShorts* pMainEntryNums, sal_uInt16 nToFind )
{
@@ -2230,11 +2178,9 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
delete pCharStyleIdx;
}
-
/*--------------------------------------------------------------------
Beschreibung: Sortiert einfuegen in das SortArr
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
{
Range aRange(0, aSortArr.Count());
@@ -2310,9 +2256,9 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
delete pNew;
return;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- DBG_ERROR("Bibliography entries cannot be found here");
+ OSL_FAIL("Bibliography entries cannot be found here");
#endif
}
if(*pNew < *pOld)
@@ -2330,7 +2276,6 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
/*--------------------------------------------------------------------
Beschreibung: Schluessel-Bereich suchen und evtl einfuegen
--------------------------------------------------------------------*/
-
Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReading,
const SwTOXSortTabBase& rNew,
sal_uInt16 nLevel, const Range& rRange )
@@ -2345,7 +2290,7 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
sToCompare.Erase( 0, 1 ).Insert( sUpper, 0 );
}
- ASSERT(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
+ OSL_ENSURE(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
const sal_uInt16 nMin = (sal_uInt16)rRange.Min();
const sal_uInt16 nMax = (sal_uInt16)rRange.Max();
@@ -2390,7 +2335,6 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
return Range(nStart, nEnd);
}
-
sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
@@ -2439,3 +2383,4 @@ sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index febab662a8fa..bf34f2a64699 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
DBG_UNHANDLED_EXCEPTION();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 93d177aed548..6ed12fd4cce5 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -292,9 +293,10 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd,
SwExtTextInput* SwDoc::GetExtTextInput() const
{
- ASSERT( !pExtInputRing || pExtInputRing == pExtInputRing->GetNext(),
+ OSL_ENSURE( !pExtInputRing || pExtInputRing == pExtInputRing->GetNext(),
"more then one InputEngine available" );
return (SwExtTextInput*)pExtInputRing;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 19638c159bc1..be40cb0fb67f 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <sal/macros.h>
#include <hintids.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <doc.hxx> // fuer GetAttrPool
-#include <errhdl.hxx>
#include <fmtcol.hxx>
#include <fmtcolfunc.hxx>
#include <hints.hxx>
@@ -50,11 +52,10 @@ TYPEINIT1( SwCollCondition, SwClient );
SV_IMPL_PTRARR( SwFmtCollConditions, SwCollConditionPtr );
-// --> OD 2008-03-04 #refactorlists#
namespace TxtFmtCollFunc
{
- // --> OD 2006-11-22 #i71574#
+ // #i71574#
void CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
SwFmt* pFmt,
const SwNumRuleItem* pNewNumRuleItem )
@@ -63,14 +64,12 @@ namespace TxtFmtCollFunc
if ( !pTxtFmtColl )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
- "<TxtFmtCollFunc::CheckTxtFmtCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTxtFmtColl>" );
+ OSL_FAIL( "<TxtFmtCollFunc::CheckTxtFmtCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTxtFmtColl>" );
#endif
return;
}
- // --> OD 2007-01-24 #i73790#
- // if ( pTxtFmtColl->AssignedToListLevelOfOutlineStyle() )
+ // #i73790#
if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle() &&
pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
// <--
@@ -143,16 +142,13 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
return;
}
- // --> OD 2006-06-16 #i66431# - adjust type of <bNewParent>
- bool bNewParent( false );
- // <--
+ bool bNewParent( false ); // #i66431# - adjust type of <bNewParent>
SvxULSpaceItem *pNewULSpace = 0, *pOldULSpace = 0;
SvxLRSpaceItem *pNewLRSpace = 0, *pOldLRSpace = 0;
SvxFontHeightItem* aFontSizeArr[3] = {0,0,0};
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
const bool bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());//#outline level ,zhaojianwei
const SwNumRuleItem* pNewNumRuleItem( 0L );
- // <--
SwAttrSetChg *pNewChgSet = 0, *pOldChgSet = 0;
@@ -172,8 +168,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
sal_False, (const SfxPoolItem**)&(aFontSizeArr[1]) );
pNewChgSet->GetChgSet()->GetItemState( RES_CHRATR_CTL_FONTSIZE,
sal_False, (const SfxPoolItem**)&(aFontSizeArr[2]) );
- // --> OD 2006-10-17 #i70223#
- // --> OD 2007-12-19 #i84745#
+ // #i70223#, #i84745#
// check, if attribute set is applied to this paragraph style
if ( bAssignedToListLevelOfOutlineStyle &&
pNewChgSet->GetTheChgdSet() == &GetAttrSet() )
@@ -194,10 +189,8 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
aFontSizeArr[0] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_FONTSIZE );
aFontSizeArr[1] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_CJK_FONTSIZE );
aFontSizeArr[2] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_CTL_FONTSIZE );
- // --> OD 2006-06-16 #i66431#
- // modify has to be propagated, because of new parent format.
+ // #i66431# - modify has to be propagated, because of new parent format.
bNewParent = true;
- // <--
}
break;
@@ -216,7 +209,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_CHRATR_CTL_FONTSIZE:
aFontSizeArr[2] = (SvxFontHeightItem*)pNew;
break;
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
case RES_PARATR_NUMRULE:
{
if ( bAssignedToListLevelOfOutlineStyle )
@@ -228,7 +221,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
break;
}
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
@@ -312,7 +305,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
- for( int nC = 0, nArrLen = sizeof(aFontSizeArr) / sizeof( aFontSizeArr[0]);
+ for( int nC = 0, nArrLen = SAL_N_ELEMENTS(aFontSizeArr);
nC < nArrLen; ++nC )
{
SvxFontHeightItem *pFSize = aFontSizeArr[ nC ], *pOldFSize;
@@ -364,7 +357,6 @@ sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const
return sal_False;
}
-// --> OD 2008-03-04 #refactorlists#
sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
{
const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
@@ -420,12 +412,12 @@ sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
}
// <--
-// --> OD 2007-01-24 #i73790#
+// #i73790#
sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
{
const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
mbStayAssignedToListLevelOfOutlineStyle = true;
- // --> OD 2008-12-16 #i70748#
+ // #i70748#
// Outline level is no longer a member, it is a attribute now.
// Thus, it needs to be restored, if the paragraph style is assigned
// to the outline style
@@ -436,7 +428,7 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
sal_uInt16 nRet = SwFmtColl::ResetAllFmtAttr();
- // --> OD 2008-12-16 #i70748#
+ // #i70748#
if ( nAssignedOutlineStyleLevel != -1 )
{
AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
@@ -449,7 +441,6 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
}
// <--
-// --> OD 2008-02-13 #newlistlevelattrs#
bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
{
bool bAreListLevelIndentsApplicable( true );
@@ -495,7 +486,7 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
}
pColl = dynamic_cast<const SwTxtFmtColl*>(pColl->DerivedFrom());
- ASSERT( pColl,
+ OSL_ENSURE( pColl,
"<SwTxtFmtColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
}
}
@@ -661,7 +652,7 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
//#outline level, zhaojianwei
void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
{
- ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
+ OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
SetFmtAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
static_cast<sal_uInt16>(nLevel) ) );
}
@@ -673,7 +664,7 @@ int SwTxtFmtColl::GetAttrOutlineLevel() const
int SwTxtFmtColl::GetAssignedOutlineStyleLevel() const
{
- ASSERT( IsAssignedToListLevelOfOutlineStyle(),
+ OSL_ENSURE( IsAssignedToListLevelOfOutlineStyle(),
"<SwTxtFmtColl::GetAssignedOutlineStyleLevel()> - misuse of method");
return GetAttrOutlineLevel() - 1;
}
@@ -683,7 +674,7 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
mbAssignedToOutlineStyle = true;
SetAttrOutlineLevel(nAssignedListLevel+1);
- // --> OD 2009-03-18 #i100277#
+ // #i100277#
SwIterator<SwTxtFmtColl,SwFmtColl> aIter( *this );
SwTxtFmtColl* pDerivedTxtFmtColl = aIter.First();
while ( pDerivedTxtFmtColl != 0 )
@@ -714,3 +705,5 @@ void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()
//<-end,zhaojianwei
//FEATURE::CONDCOLL
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 40579fddd960..0304d41ddf3d 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -397,3 +398,4 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::ChkNumber( const SwTxtFtn& rTxtFtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 607bb4f79c2e..eb1864073088 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -396,7 +397,7 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
SwTableLines& rLns = *pGCPara->pLns;
const SwTableLine* pTmp = pLn;
sal_uInt16 nInsPos = rLns.GetPos( pTmp );
- ASSERT( USHRT_MAX != nInsPos, "Line nicht gefunden!" );
+ OSL_ENSURE( USHRT_MAX != nInsPos, "Line nicht gefunden!" );
SwTableBox* pUpper = pLn->GetUpper();
@@ -449,3 +450,4 @@ void SwTable::GCLines()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index c4e89fc12576..0147bdce47ca 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,6 @@
#include "precompiled_sw.hxx"
#include "hintids.hxx"
-//#define TEST_DELAYED_RESIZE
-
-#ifdef TEST_DELAYED_RESIZE
-#include <vcl/sound.hxx>
-#endif
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
#include <sot/storage.hxx>
@@ -90,7 +86,6 @@ public:
sal_uInt16 GetColumn() const { return nCol; }
};
-/* */
SwHTMLTableLayoutCnts::SwHTMLTableLayoutCnts( const SwStartNode *pSttNd,
SwHTMLTableLayout* pTab,
@@ -112,8 +107,6 @@ const SwStartNode *SwHTMLTableLayoutCnts::GetStartNode() const
}
-/* */
-
SwHTMLTableLayoutCell::SwHTMLTableLayoutCell( SwHTMLTableLayoutCnts *pCnts,
sal_uInt16 nRSpan, sal_uInt16 nCSpan,
sal_uInt16 nWidth, sal_Bool bPrcWidth,
@@ -132,7 +125,6 @@ SwHTMLTableLayoutCell::~SwHTMLTableLayoutCell()
}
}
-/* */
SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
sal_Bool bRelWidth,
@@ -145,8 +137,6 @@ SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
{}
-/* */
-
SwHTMLTableLayoutConstraints::SwHTMLTableLayoutConstraints(
sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRw, sal_uInt16 nColumn, sal_uInt16 nColSp ):
nRow( nRw ), nCol( nColumn ), nColSpan( nColSp ),
@@ -188,7 +178,6 @@ SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
return pConstr;
}
-/* */
typedef SwHTMLTableLayoutColumn *SwHTMLTableLayoutColumnPtr;
typedef SwHTMLTableLayoutCell *SwHTMLTableLayoutCellPtr;
@@ -271,7 +260,7 @@ sal_uInt16 SwHTMLTableLayout::GetLeftCellSpace( sal_uInt16 nCol, sal_uInt16 nCol
else if( nCol+nColSpan == nCols && nRightBorderWidth &&
nSpace < MIN_BORDER_DIST )
{
- ASSERT( !nCellPadding, "GetLeftCellSpace: CELLPADDING!=0" );
+ OSL_ENSURE( !nCellPadding, "GetLeftCellSpace: CELLPADDING!=0" );
// Wenn die Gegenueberliegende Seite umrandet ist muessen
// wir zumindest den minimalen Abstand zum Inhalt
// beruecksichtigen. (Koennte man zusaetzlich auch an
@@ -297,7 +286,7 @@ sal_uInt16 SwHTMLTableLayout::GetRightCellSpace( sal_uInt16 nCol, sal_uInt16 nCo
else if( bSwBorders && GetColumn(nCol)->HasLeftBorder() &&
nSpace < MIN_BORDER_DIST )
{
- ASSERT( !nCellPadding, "GetRightCellSpace: CELLPADDING!=0" );
+ OSL_ENSURE( !nCellPadding, "GetRightCellSpace: CELLPADDING!=0" );
// Wenn die Gegenueberliegende Seite umrandet ist muessen
// wir zumindest den minimalen Abstand zum Inhalt
// beruecksichtigen. (Koennte man zusaetzlich auch an
@@ -372,7 +361,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
return (sal_uInt16)pPageFrm->Prt().Width();
}
- // --> OD 2010-05-12 #i91658#
+ // #i91658#
// Assertion removed which state that no browse width is available.
// Investigation reveals that all calls can handle the case that no browse
// width is provided.
@@ -435,9 +424,9 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const
const SwTableBox* pBox = pSwTable->GetTabLines()[0]->GetTabBoxes()[0];
while( 0 == (pBoxSttNd = pBox->GetSttNd()) )
{
- ASSERT( pBox->GetTabLines().Count() > 0,
+ OSL_ENSURE( pBox->GetTabLines().Count() > 0,
"Box ohne Start-Node und Lines" );
- ASSERT( pBox->GetTabLines()[0]->GetTabBoxes().Count() > 0,
+ OSL_ENSURE( pBox->GetTabLines()[0]->GetTabBoxes().Count() > 0,
"Line ohne Boxen" );
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
}
@@ -448,22 +437,19 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const
SwFrmFmt *SwHTMLTableLayout::FindFlyFrmFmt() const
{
const SwTableNode *pTblNd = GetAnyBoxStartNode()->FindTableNode();
- ASSERT( pTblNd, "Kein Table-Node?" );
+ OSL_ENSURE( pTblNd, "Kein Table-Node?" );
return pTblNd->GetFlyFmt();
}
static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlignCnts,
sal_uLong& rAbsMinNoAlignCnts,
-#ifdef FIX41370
- sal_Bool& rHR,
-#endif
SwTxtNode *pTxtNd, sal_uLong nIdx, sal_Bool bNoBreak )
{
pTxtNd->GetMinMaxSize( nIdx, rMinNoAlignCnts, rMaxNoAlignCnts,
rAbsMinNoAlignCnts );
- ASSERT( rAbsMinNoAlignCnts <= rMinNoAlignCnts,
+ OSL_ENSURE( rAbsMinNoAlignCnts <= rMinNoAlignCnts,
"GetMinMaxSize: absmin > min" );
- ASSERT( rMinNoAlignCnts <= rMaxNoAlignCnts,
+ OSL_ENSURE( rMinNoAlignCnts <= rMaxNoAlignCnts,
"GetMinMaxSize: max > min" );
//Bei einen <PRE>-Absatz entspricht die maximale Breite der
@@ -482,14 +468,6 @@ static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlig
rMinNoAlignCnts = rMaxNoAlignCnts;
rAbsMinNoAlignCnts = rMaxNoAlignCnts;
}
-#ifdef FIX41370
- else if( pColl && RES_POOLCOLL_HTML_HR==pColl->GetPoolFmtId() )
- {
- rHR |= !pTxtNd->HasSwAttrSet() ||
- SFX_ITEM_SET != pTxtNd->GetpSwAttrSet()
- ->GetItemState( RES_LR_SPACE, sal_False );
- }
-#endif
}
void SwHTMLTableLayout::AutoLayoutPass1()
@@ -517,7 +495,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
SwHTMLTableLayoutCell *pCell = GetCell(j,i);
SwHTMLTableLayoutCnts *pCnts = pCell->GetContents();
- // fix #31488#: Zum Ermitteln der naechsten zu berechnenden
+ // Zum Ermitteln der naechsten zu berechnenden
// Spalte muessen alle Zeilen herangezogen werden
sal_uInt16 nColSpan = pCell->GetColSpan();
if( nColSpan < nColSkip )
@@ -535,9 +513,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
sal_uLong nAbsMinNoAlignCell = 0;
sal_uLong nMaxTableCell = 0;
sal_uLong nAbsMinTableCell = 0;
-#ifdef FIX41370
- sal_Bool bHR = sal_False;
-#endif
while( pCnts )
{
@@ -558,9 +533,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
lcl_GetMinMaxSize( nMinNoAlignCnts,
nMaxNoAlignCnts,
nAbsMinNoAlignCnts,
-#ifdef FIX41370
- bHR,
-#endif
pTxtNd, nIdx,
pCnts->HasNoBreakTag() );
@@ -612,7 +584,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
else
{
- ASSERT( !this, "Sub tables in HTML import?" )
+ OSL_ENSURE( !this, "Sub tables in HTML import?" );
SwHTMLTableLayout *pChild = pCnts->GetTable();
pChild->AutoLayoutPass1();
sal_uLong nMaxTableCnts = pChild->nMax;
@@ -681,24 +653,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
nAbsMinNoAlignCell = nWidth;
}
}
-#ifdef FIX41370
- else if( bHR && nWidth>0 && !bRelWidth )
- {
- // Ein kleiner Hack, um einen Bug in Netscape 4.0
- // nachzubilden (siehe #41370#). Wenn eine Zelle eine
- // fixe Breite besitzt und gleichzeitig ein HR, wird
- // sie nie schmaler als die angegebene Breite.
- // (Genaugenomen scheint die Zelle nie schmaler zu werden
- // als die HR-Linie, denn wenn man fuer die Linie eine
- // Breite angibt, die breiter ist als die der Zelle, dann
- // wird die Zelle so breit wie die Linie. Das bekommen wir
- // natuerlich nicht hin.)
- if( nWidth>nMinNoAlignCell )
- nMinNoAlignCell = nWidth;
- if( nWidth>nAbsMinNoAlignCell )
- nAbsMinNoAlignCell = nWidth;
- }
-#endif
// Mindestbreite fuer Inhalt einhalten
if( nMinNoAlignCell < MINLAY )
@@ -767,9 +721,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
}
- ASSERT( nMinColSpan>0 && nColSkip>0 && nColSkip <= nMinColSpan,
+ OSL_ENSURE( nMinColSpan>0 && nColSkip>0 && nColSkip <= nMinColSpan,
"Layout Pass 1: Da werden Spalten vergessen!" );
- ASSERT( nMinColSpan!=USHRT_MAX,
+ OSL_ENSURE( nMinColSpan!=USHRT_MAX,
"Layout Pass 1: unnoetiger Schleifendurchlauf oder Bug" );
if( 1==nMinColSpan )
@@ -887,7 +841,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
: nDiff;
nColMin += nAdd;
nMin += nColMin;
- ASSERT( nDiff >= nAdd, "Ooops: nDiff stimmt nicht mehr" );
+ OSL_ENSURE( nDiff >= nAdd, "Ooops: nDiff stimmt nicht mehr" );
nDiff -= nAdd;
if( nColMax < nColMin )
@@ -915,8 +869,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->AddToMin( nDiff );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
- "Wieso ist die SPalte auf einmal zu schmal?" )
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
+ "Wieso ist die SPalte auf einmal zu schmal?" );
nMin += nDiff;
nMinD -= nDiff;
@@ -988,7 +942,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
}
}
- ASSERT( 0==nRel || nQuot!=ULONG_MAX,
+ OSL_ENSURE( 0==nRel || nQuot!=ULONG_MAX,
"Wo sind die relativen Spalten geblieben?" );
for( i=0; i<nCols; i++ )
{
@@ -999,7 +953,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->SetMax( pColumn->GetMax() / nQuot );
else
pColumn->SetMax( pColumn->GetMin() );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
"Maximale Spaltenbreite kleiner als Minimale" );
nMax += pColumn->GetMax();
}
@@ -1012,7 +966,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
sal_uLong nRelMax = 0; // Anteil am Maximum dieser Spalten
for( i=0; i<nCols; i++ )
{
- ASSERT( nRel<=100, "relative Breite aller Spalten>100%" );
+ OSL_ENSURE( nRel<=100, "relative Breite aller Spalten>100%" );
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
if( pColumn->IsRelWidthOption() && pColumn->GetWidthOption() )
{
@@ -1099,7 +1053,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->SetMax( pColumn->GetMin() );
}
// und durch den Quotienten teilen
- ASSERT( nQuotMax!=ULONG_MAX, "Wo sind die relativen Spalten geblieben?" );
+ OSL_ENSURE( nQuotMax!=ULONG_MAX, "Wo sind die relativen Spalten geblieben?" );
for( i=0; i<nCols; i++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
@@ -1108,7 +1062,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( pColumn->GetWidthOption() )
{
pColumn->SetMax( pColumn->GetMax() / nQuotMax );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
"Minimalbreite ein Spalte Groesser Maximum" );
if( pColumn->GetMax() < pColumn->GetMin() )
pColumn->SetMax( pColumn->GetMin() );
@@ -1135,16 +1089,16 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Eine abolute zur Verfuegung stehende Breite muss immer uebergeben
// werden.
- ASSERT( nAbsAvail, "AutoLayout Pass 2: Keine absolute Breite gegeben" );
+ OSL_ENSURE( nAbsAvail, "AutoLayout Pass 2: Keine absolute Breite gegeben" );
// Eine realtive zur Verfuegung stehende Breite darf nur und muss fuer
// Tabellen in Tabellen uebergeben
- ASSERT( IsTopTable() == (nRelAvail==0),
+ OSL_ENSURE( IsTopTable() == (nRelAvail==0),
"AutoLayout Pass 2: Rel. Breite bei Tab in Tab oder umgekehrt" );
// Die Minimalbreite der Tabelle darf natuerlich nie groesser sein
// als das die Maximalbreite.
- ASSERT( nMin<=nMax, "AutoLayout Pass2: nMin > nMax" );
+ OSL_ENSURE( nMin<=nMax, "AutoLayout Pass2: nMin > nMax" );
// Die verfuegbare Breite, fuer die die Tabelle berechnet wurde, merken.
// (Dies ist ein guter Ort, denn hier kommer wir bei der Erstberechnung
@@ -1213,7 +1167,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
{
if( bPrcWidthOption )
{
- ASSERT( nWidthOption<=100, "Prozentangabe zu gross" );
+ OSL_ENSURE( nWidthOption<=100, "Prozentangabe zu gross" );
if( nWidthOption > 100 )
nWidthOption = 100;
@@ -1227,7 +1181,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Weil bei Tabellen in Rahmen kein Resize aufgerufen wird,
// wenn der Rahmen eine nicht-relative Breite besitzt, koennen
// wir da solche Spielchen nicht spielen
- // MIB 19.2.98: Wegen fix #47394# spielen wir solche Spielchen
+ // Spielen wir solche Spielchen
// jetzt doch. Dort war eine Grafik in einer 1%-breiten
// Tabelle und hat da natuerlich nicht hineingepasst.
nAbsTabWidth = (sal_uInt16)( ((sal_uLong)nAbsAvail * nWidthOption) / 100 );
@@ -1251,9 +1205,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
}
}
- ASSERT( IsTopTable() || nAbsTabWidth<=nAbsAvail,
+ OSL_ENSURE( IsTopTable() || nAbsTabWidth<=nAbsAvail,
"AutoLayout Pass2: nAbsTabWidth > nAbsAvail fuer Tab in Tab" );
- ASSERT( !nRelAvail || nAbsTabWidth<=nAbsAvail,
+ OSL_ENSURE( !nRelAvail || nAbsTabWidth<=nAbsAvail,
"AutoLayout Pass2: nAbsTabWidth > nAbsAvail fuer relative Breite" );
// Catch fuer die beiden Asserts von oben (man weiss ja nie!)
@@ -1377,7 +1331,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Eine Top-Table darf auch beriter werden als der verfuegbare Platz.
if( nAbsTabWidth > nAbsAvail )
{
- ASSERT( IsTopTable(),
+ OSL_ENSURE( IsTopTable(),
"Tabelle in Tabelle soll breiter werden als umgebende Zelle" );
nAbsAvail = nAbsTabWidth;
}
@@ -1407,7 +1361,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// die ihre Maximalbreite genau einhalten, also weder
// schmaler noch breiter werden. Beim zurueckrechnen der
// absoluten Breite aus der relativen Breite kann es
- // zu Rundungsfehlern kommen (bug #45598#). Um die auszugeleichen
+ // zu Rundungsfehlern kommen. Um die auszugeleichen
// werden zuerst die fixen Breiten entsprechend korrigiert
// eingestellt und erst danach die relativen.
@@ -1444,7 +1398,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// absoluten Breiten. nFixMax entspricht an dieser Stelle
// nAbs, so dass man gleich nFixMax haette nehmen koennen.
// Der Code ist so aber verstaendlicher.
- ASSERT( nFixMax == nAbs, "Zwei Schleifen, zwei Summen?" )
+ OSL_ENSURE( nFixMax == nAbs, "Zwei Schleifen, zwei Summen?" );
sal_uLong nDistMax = nMax - nFixMax;
sal_uInt16 nDistAbsTabWidth = nAbsTabWidth - nAbs;
sal_uInt16 nDistRelTabWidth = nRelTabWidth - nRel;
@@ -1473,7 +1427,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
nRel = nRel + pColumn->GetRelColWidth();
}
}
- ASSERT( nCols==nFixedCols, "Spalte vergessen!" );
+ OSL_ENSURE( nCols==nFixedCols, "Spalte vergessen!" );
}
else
{
@@ -1500,7 +1454,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nAbsTabWidth > nAbsAvail )
{
- ASSERT( IsTopTable(),
+ OSL_ENSURE( IsTopTable(),
"Tabelle in Tabelle soll breiter werden als Platz da ist" );
nAbsAvail = nAbsTabWidth;
}
@@ -1572,9 +1526,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
break;
}
- ASSERT( !pLeftFillerBox || nRelLeftFill>0,
+ OSL_ENSURE( !pLeftFillerBox || nRelLeftFill>0,
"Fuer linke Filler-Box ist keine Breite da!" );
- ASSERT( !pRightFillerBox || nRelRightFill>0,
+ OSL_ENSURE( !pRightFillerBox || nRelRightFill>0,
"Fuer rechte Filler-Box ist keine Breite da!" );
// Filler-Breiten werden auf die ausseren Spalten geschlagen, wenn
@@ -1585,7 +1539,6 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nRelLeftFill && !pLeftFillerBox &&
( nWidthSet>0 || nAbsLeftFill<MINLAY+nInhLeftBorderWidth ||
(HasColTags() && nAbsLeftFill < nAbsLeftSpace+nParentInhAbsLeftSpace+20) ) )
-// (nAbsLeftFill<MINLAY || nAbsLeftFill<=nAbsLeftSpace) )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( 0 );
pColumn->SetAbsColWidth( pColumn->GetAbsColWidth()+nAbsLeftFill );
@@ -1596,7 +1549,6 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nRelRightFill && !pRightFillerBox &&
( nWidthSet>0 || nAbsRightFill<MINLAY+nInhRightBorderWidth ||
(HasColTags() && nAbsRightFill < nAbsRightSpace+nParentInhAbsRightSpace+20) ) )
-// (nAbsRightFill<MINLAY || nAbsRightFill<=nAbsRightSpace) )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( nCols-1 );
pColumn->SetAbsColWidth( pColumn->GetAbsColWidth()+nAbsRightFill );
@@ -1631,14 +1583,14 @@ static sal_Bool lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara )
static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
{
sal_uInt16 *pWidth = (sal_uInt16 *)pPara;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nOldWidth = *pWidth;
#endif
*pWidth = 0;
((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth );
-#ifdef DBG_UTIL
- ASSERT( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY,
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY,
"Zeilen einer Box sind unterschiedlich lang" );
#endif
@@ -1712,7 +1664,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail,
sal_uInt16 nCalcTabWidth = 0;
((SwTable *)pSwTable)->GetTabLines().ForEach( &lcl_ResizeLine,
&nCalcTabWidth );
- ASSERT( Abs( nRelTabWidth-nCalcTabWidth ) < COLFUZZY,
+ OSL_ENSURE( Abs( nRelTabWidth-nCalcTabWidth ) < COLFUZZY,
"Tabellebreite stimmt nicht mit Zeilenbreite ueberein." );
// Beim Anpassen des Tabellen-Formats dieses locken, weil sonst
@@ -1748,7 +1700,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail,
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
// steht im tblrwcl.cxx
extern void _CheckBoxWidth( const SwTableLine&, SwTwips );
@@ -1799,9 +1751,6 @@ void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
{
-#ifdef TEST_DELAYED_RESIZE
- Sound::Beep( SOUND_WARNING );
-#endif
pThis->aResizeTimer.Stop();
pThis->_Resize( pThis->nDelayedResizeAbsAvail,
pThis->bDelayedResizeRecalc );
@@ -1815,7 +1764,7 @@ sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
{
if( 0 == nAbsAvail )
return sal_False;
- ASSERT( IsTopTable(), "Resize darf nur an Top-Tabellen aufgerufen werden" );
+ OSL_ENSURE( IsTopTable(), "Resize darf nur an Top-Tabellen aufgerufen werden" );
// Darf die Tabelle uberhaupt Resized werden oder soll sie es trotzdem?
if( bMustNotResize && !bForce )
@@ -1875,9 +1824,6 @@ sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
bDelayedResizeRecalc = bRecalc;
aResizeTimer.SetTimeout( nDelay );
aResizeTimer.Start();
-#ifdef TEST_DELAYED_RESIZE
- Sound::Beep( SOUND_DEFAULT );
-#endif
}
else
{
@@ -1895,3 +1841,4 @@ void SwHTMLTableLayout::BordersChanged( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index c29e7a80c665..3fa6e2e0867d 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "lineinfo.hxx"
#include "charfmt.hxx"
@@ -138,7 +137,7 @@ SwCharFmt* SwLineNumberInfo::GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) cons
void SwLineNumberInfo::SetCharFmt( SwCharFmt *pChFmt )
{
- ASSERT( pChFmt, "SetCharFmt, 0 is not a valid pointer" );
+ OSL_ENSURE( pChFmt, "SetCharFmt, 0 is not a valid pointer" );
pChFmt->Add( this );
}
@@ -157,3 +156,4 @@ void SwLineNumberInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index 81f139bba99e..3fc2ee0500dd 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -289,15 +290,4 @@ bool SwList::IsListLevelMarked( const int nListLevel ) const
return mpListImpl->IsListLevelMarked( nListLevel );
}
-//void SwList::ContinueList( SwList& rList )
-//{
-// mpListImpl->ContinueList( rList );
-//}
-//const SwList* SwList::GetContinuedList() const
-//{
-// return mpListImpl->GetContinuedList();
-//}
-//void SwList::ClearContinuation()
-//{
-// mpListImpl->ClearContinuation();
-//}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 74da906022f6..d00e8d6415c8 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,9 +79,7 @@
#include <svtools/embedhlp.hxx>
#include <svtools/chartprettypainter.hxx>
-// --> OD 2009-03-05 #i99665#
-#include <dview.hxx>
-// <--
+#include <dview.hxx> // #i99665#
using namespace com::sun::star;
@@ -153,10 +152,6 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
|*
|* SwGrfFrm::SwGrfFrm(ViewShell * const,SwGrfNode *)
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 03. Mar. 93
-|*
*************************************************************************/
@@ -183,10 +178,6 @@ void SwNoTxtFrm::InitCtor()
|*
|* SwNoTxtNode::MakeFrm()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 03. Mar. 93
-|*
*************************************************************************/
@@ -199,10 +190,6 @@ SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib )
|*
|* SwNoTxtFrm::~SwNoTxtFrm()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 30. Apr. 96
-|*
*************************************************************************/
SwNoTxtFrm::~SwNoTxtFrm()
@@ -214,10 +201,6 @@ SwNoTxtFrm::~SwNoTxtFrm()
|*
|* void SwNoTxtFrm::Modify( SwHint * pOld, SwHint * pNew )
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung JP 05.03.91
-|*
*************************************************************************/
void SetOutDev( ViewShell *pSh, OutputDevice *pOut )
@@ -243,7 +226,6 @@ void lcl_ClearArea( const SwFrm &rFrm,
::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
else
{
- // OD 2004-04-23 #116347#
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
@@ -258,10 +240,6 @@ void lcl_ClearArea( const SwFrm &rFrm,
|*
|* void SwNoTxtFrm::Paint()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 10. Jan. 97
-|*
*************************************************************************/
void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
@@ -273,7 +251,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
- // OD 10.01.2003 #i6467# - no paint of placeholder for page preview
+ // #i6467# - no paint of placeholder for page preview
if ( pSh->GetWin() && !pSh->IsPreView() )
{
const SwNoTxtNode* pNd = GetNode()->GetNoTxtNode();
@@ -305,7 +283,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( pGrfNd )
pGrfNd->SetFrameInPaint( sal_True );
- // OD 16.04.2003 #i13147# - add 2nd parameter with value <sal_True> to
+ // #i13147# - add 2nd parameter with value <sal_True> to
// method call <FindFlyFrm().GetContour(..)> to indicate that it is called
// for paint in order to avoid load of the intrinsic graphic.
if ( ( !pOut->GetConnectMetaFile() ||
@@ -342,7 +320,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( bClip )
pOut->IntersectClipRegion( aPaintArea.SVRect() );
- /// OD 25.09.2002 #99739# - delete unused 3rd parameter
+ /// delete unused 3rd parameter
PaintPicture( pOut, aGrfArea );
}
else
@@ -366,8 +344,6 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|* Parameter Point& die Position im Frame ( auch Return-Wert )
|* Size& die Groesse der Grafik ( auch Return-Wert )
|* MirrorGrf akt. Spiegelungs-Attribut
-|* Ersterstellung JP 04.03.91
-|* Letzte Aenderung JP 31.08.94
|*
*************************************************************************/
@@ -394,17 +370,13 @@ void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror )
|* Beschreibung Errechne die Position und die Groesse der Bitmap
|* innerhalb des uebergebenem Rechtecks.
|*
-|* Ersterstellung JP 03.09.91
-|* Letzte Aenderung MA 11. Oct. 94
-|*
*************************************************************************/
void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
sal_Bool ) const
{
- // JP 23.01.2001: currently only used for scaling, cropping and mirroring
- // the contour of graphics!
- // all other is handled by the GraphicObject
+ //currently only used for scaling, cropping and mirroring the contour of graphics!
+ //all other is handled by the GraphicObject
//In rRect wird das sichbare Rechteck der Grafik gesteckt.
//In pOrigRect werden Pos+Size der Gesamtgrafik gesteck.
@@ -522,8 +494,6 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
|*
|* Beschreibung Gebe die Groesse des umgebenen FLys und
|* damit die der Grafik zurueck.
-|* Ersterstellung JP 04.03.91
-|* Letzte Aenderung JP 31.08.94
|*
*************************************************************************/
@@ -541,9 +511,6 @@ const Size& SwNoTxtFrm::GetSize() const
|*
|* SwNoTxtFrm::MakeAll()
|*
-|* Ersterstellung MA 29. Nov. 96
-|* Letzte Aenderung MA 29. Nov. 96
-|*
*************************************************************************/
@@ -574,8 +541,6 @@ void SwNoTxtFrm::MakeAll()
|* SwNoTxtFrm::Format()
|*
|* Beschreibung Errechne die Groesse der Bitmap, wenn noetig
-|* Ersterstellung JP 11.03.91
-|* Letzte Aenderung MA 13. Mar. 96
|*
*************************************************************************/
@@ -598,10 +563,6 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * )
|*
|* SwNoTxtFrm::GetCharRect()
|*
-|* Beschreibung
-|* Ersterstellung SS 29-Apr-1991
-|* Letzte Aenderung MA 10. Oct. 94
-|*
|*************************************************************************/
@@ -665,7 +626,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
- // --> OD 2007-03-06 #i73788#
+ // #i73788#
// no <SwCntntFrm::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
RES_GRAPHIC_ARRIVED != nWhich &&
@@ -737,10 +698,8 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_GRAPHIC_PIECE_ARRIVED:
case RES_GRAPHIC_ARRIVED:
- // --> OD 2007-03-06 #i73788#
- // handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
+ // i73788# - handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
case RES_LINKED_GRAPHIC_STREAM_ARRIVED:
- // <--
if ( GetNode()->GetNodeType() == ND_GRFNODE )
{
bComplete = sal_False;
@@ -766,7 +725,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else if ( pSh->VisArea().IsOver( aRect ) &&
OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() )
{
- // OD 27.11.2002 #105519# - invalidate instead of painting
+ //invalidate instead of painting
pSh->GetWin()->Invalidate( aRect.SVRect() );
}
@@ -819,9 +778,9 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
// Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder
// eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird
// eine Ersatzdarstellung ausgegeben.
-/// OD 25.09.2002 #99739# - delete unused 3rd parameter.
-/// OD 25.09.2002 #99739# - use aligned rectangle for drawing graphic.
-/// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
+/// delete unused 3rd parameter.
+/// use aligned rectangle for drawing graphic.
+/// pixel-align coordinations for drawing graphic.
void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
{
ViewShell* pShell = getRootFrm()->GetCurrShell();
@@ -835,7 +794,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
- /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
+ /// calculate aligned rectangle from parameter <rGrfArea>.
/// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
/// the following code.
SwRect aAlignedGrfArea = rGrfArea;
@@ -843,7 +802,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( !bIsChart )
{
- /// OD 25.09.2002 #99739#
/// Because for drawing a graphic left-top-corner and size coordinations are
/// used, these coordinations have to be determined on pixel level.
::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
@@ -868,14 +826,13 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( !bPrn )
{
- // --> OD 2007-01-02 #i73788#
+ // #i73788#
if ( pGrfNd->IsLinkedInputStreamReady() )
{
pGrfNd->UpdateLinkWithInputStream();
}
// <--
- // --> OD 2008-01-30 #i85717#
- // --> OD 2008-07-21 #i90395# - check, if asynchronous retrieval
+ // #i85717#, #i90395# - check, if asynchronous retrieval
// if input stream for the graphic is possible
// else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT ||
@@ -891,9 +848,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
!(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
!aTmpSz.Height() || !pGrfNd->GetAutoFmtLvl() )
{
- // --> OD 2006-12-22 #i73788#
- pGrfNd->TriggerAsyncRetrieveInputStream();
- // <--
+ pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
}
String aTxt( pGrfNd->GetTitle() );
if ( !aTxt.Len() )
@@ -936,7 +891,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
else
pVout = 0;
- ASSERT( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
+ OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
pShell->GetViewOptions()->IsPDFExport(),
"pOut sollte kein virtuelles Device sein" );
@@ -991,7 +946,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
}
else if( pOLENd )
{
- // --> OD 2009-03-05 #i99665#
+ // #i99665#
// Adjust AntiAliasing mode at output device for chart OLE
const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
if ( pOLENd->IsChart() &&
@@ -1014,18 +969,10 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pJobSetup = new JobSetup();
// #i42323#
- // The reason for #114233# is gone, so i remove it again
//TODO/LATER: is it a problem that the JopSetup isn't used?
//xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup );
- // get hi-contrast image, but never for printing
- Graphic* pGraphic = NULL;
- if (pOut && !bPrn && Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- pGraphic = pOLENd->GetHCGraphic();
-
- // when it is not possible to get HC-representation, the original image should be used
- if ( !pGraphic )
- pGraphic = pOLENd->GetGraphic();
+ Graphic* pGraphic = pOLENd->GetGraphic();
if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE )
{
@@ -1049,11 +996,11 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
{
const SwFlyFrm *pFly = FindFlyFrm();
- ASSERT( pFly, "OLE not in FlyFrm" );
+ OSL_ENSURE( pFly, "OLE not in FlyFrm" );
((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
}
- // --> OD 2009-03-05 #i99665#
+ // #i99665#
if ( pOLENd->IsChart() &&
pShell->Imp()->GetDrawView()->IsAntiAliasing() )
{
@@ -1096,3 +1043,4 @@ sal_Bool SwNoTxtFrm::HasAnimation() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index ee1b832fd777..a5d12082f8fd 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,28 +45,23 @@
#include <frmfmt.hxx>
#include <ndtxt.hxx>
#include <docary.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <SwStyleNameMapper.hxx>
-// --> OD 2006-06-28 #b6440955#
+
// Needed to load default bullet list configuration
#include <unotools/configitem.hxx>
-// <--
+
#include <numrule.hxx>
#include <SwNodeNum.hxx>
-#include <hash_map>
-// --> OD 2008-02-19 #refactorlists#
+#include <boost/unordered_map.hpp>
+
#include <list.hxx>
#include <algorithm>
-// <--
-// --> OD 2008-06-06 #i89178#
+
#include <unotools/saveopt.hxx>
-// <--
-// --> OD 2008-07-08 #i91400#
+
#include <IDocumentListsAccess.hxx>
-// <--
using namespace ::com::sun::star;
@@ -73,14 +69,13 @@ using namespace ::com::sun::star;
sal_uInt16 SwNumRule::nRefCount = 0;
SwNumFmt* SwNumRule::aBaseFmts[ RULE_END ][ MAXLEVEL ] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
-// --> OD 2008-02-11 #newlistlevelattrs#
+
SwNumFmt* SwNumRule::aLabelAlignmentBaseFmts[ RULE_END ][ MAXLEVEL ] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
char sOutline[] = "Outline";
char* SwNumRule::pDefOutlineName = sOutline;
-// #i30312#
sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = {
//inch: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
1440/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2,
@@ -89,21 +84,19 @@ sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = {
const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const
{
- ASSERT_ID( i < MAXLEVEL && eRuleType < RULE_END, ERR_NUMLEVEL);
+ OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END );
return aFmts[ i ]
? *aFmts[ i ]
- // --> OD 2008-02-11 #newlistlevelattrs#
: ( meDefaultNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
? *aBaseFmts[ eRuleType ][ i ]
: *aLabelAlignmentBaseFmts[ eRuleType ][ i ] );
- // <--
}
const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
{
const SwNumFmt * pResult = NULL;
- ASSERT_ID( i < MAXLEVEL && eRuleType < RULE_END, ERR_NUMLEVEL);
+ OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END );
if ( i < MAXLEVEL && eRuleType < RULE_END)
{
pResult = aFmts[ i ];
@@ -112,7 +105,7 @@ const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
return pResult;
}
-// --> OD 2008-07-08 #i91400#
+// #i91400#
void SwNumRule::SetName( const String & rName,
IDocumentListsAccess& rDocListAccess)
// <--
@@ -124,29 +117,29 @@ void SwNumRule::SetName( const String & rName,
pNumRuleMap->erase(sName);
(*pNumRuleMap)[rName] = this;
- // --> OD 2008-07-08 #i91400#
if ( GetDefaultListId().Len() > 0 )
{
rDocListAccess.trackChangeOfListStyleName( sName, rName );
}
- // <--
}
sName = rName;
}
}
-// --> OD 2008-02-19 #refactorlists#
+
void SwNumRule::GetTxtNodeList( SwNumRule::tTxtNodeList& rTxtNodeList ) const
{
rTxtNodeList = maTxtNodeList;
}
+
SwNumRule::tTxtNodeList::size_type SwNumRule::GetTxtNodeListSize() const
{
return maTxtNodeList.size();
}
+
void SwNumRule::AddTxtNode( SwTxtNode& rTxtNode )
{
tTxtNodeList::iterator aIter =
@@ -158,6 +151,7 @@ void SwNumRule::AddTxtNode( SwTxtNode& rTxtNode )
}
}
+
void SwNumRule::RemoveTxtNode( SwTxtNode& rTxtNode )
{
tTxtNodeList::iterator aIter =
@@ -168,9 +162,9 @@ void SwNumRule::RemoveTxtNode( SwTxtNode& rTxtNode )
maTxtNodeList.erase( aIter );
}
}
-// <--
-void SwNumRule::SetNumRuleMap(std::hash_map<String, SwNumRule *, StringHash> *
+
+void SwNumRule::SetNumRuleMap(boost::unordered_map<String, SwNumRule *, StringHash> *
_pNumRuleMap)
{
pNumRuleMap = _pNumRuleMap;
@@ -178,35 +172,29 @@ void SwNumRule::SetNumRuleMap(std::hash_map<String, SwNumRule *, StringHash> *
sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl )
{
- ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
+ OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
}
sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl )
{
- ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
+ OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
}
-
-
static void lcl_SetRuleChgd( SwTxtNode& rNd, sal_uInt8 nLevel )
{
if( rNd.GetActualListLevel() == nLevel )
rNd.NumRuleChgd();
}
-/* -----------------------------22.02.01 13:41--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt() :
SvxNumberFormat(SVX_NUM_ARABIC),
SwClient( 0 ),
pVertOrient(new SwFmtVertOrient( 0, text::VertOrientation::NONE))
{
}
-/* -----------------------------22.02.01 13:42--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SvxNumberFormat(rFmt),
SwClient( rFmt.GetRegisteredInNonConst() ),
@@ -216,9 +204,7 @@ SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SetGraphicBrush( rFmt.GetBrush(), &rFmt.GetGraphicSize(),
&eMyVertOrient);
}
-/* -----------------------------22.02.01 13:58--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
SvxNumberFormat(rNumFmt),
pVertOrient(new SwFmtVertOrient( 0, rNumFmt.GetVertOrient()))
@@ -244,16 +230,12 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
GetRegisteredInNonConst()->Remove( this );
}
-/* -----------------------------22.02.01 13:42--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::~SwNumFmt()
{
delete pVertOrient;
}
-/* -----------------------------02.07.01 15:37--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::NotifyGraphicArrived()
{
if( GetCharFmt() )
@@ -267,34 +249,9 @@ sal_Bool SwNumFmt::IsEnumeration() const
// using this code. Therefore HBRINKM and I agreed upon defining
// IsEnumeration() as !IsItemize()
return !IsItemize();
- // <--
-
- /*
- sal_Bool bResult;
-
- switch(GetNumberingType())
- {
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_ROMAN_UPPER:
- case SVX_NUM_ROMAN_LOWER:
- case SVX_NUM_ARABIC:
- case SVX_NUM_PAGEDESC:
- case SVX_NUM_CHARS_UPPER_LETTER_N:
- case SVX_NUM_CHARS_LOWER_LETTER_N:
- bResult = sal_True;
-
- break;
-
- default:
- bResult = sal_False;
- }
-
- return bResult;
- */
}
-// #i29560#
+
sal_Bool SwNumFmt::IsItemize() const
{
sal_Bool bResult;
@@ -315,10 +272,6 @@ sal_Bool SwNumFmt::IsItemize() const
}
-
-/* -----------------------------23.02.01 09:28--------------------------------
-
- ---------------------------------------------------------------------------*/
SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
{
SvxNumberFormat::operator=(rNumFmt);
@@ -328,9 +281,7 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
GetRegisteredInNonConst()->Remove( this );
return *this;
}
-/* -----------------------------23.02.01 09:28--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) &&
@@ -338,9 +289,6 @@ sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
return bRet;
}
-/* -----------------------------22.02.01 13:44--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
{
if( pChFmt )
@@ -348,9 +296,7 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
else if( GetRegisteredIn() )
GetRegisteredInNonConst()->Remove( this );
}
-/* -----------------------------22.02.01 13:45--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses
@@ -370,16 +316,12 @@ void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else
CheckRegistration( pOld, pNew );
}
-/* -----------------------------23.02.01 11:08--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetCharFmtName(const String& rSet)
{
SvxNumberFormat::SetCharFmtName(rSet);
}
-/* -----------------------------22.02.01 13:47--------------------------------
- ---------------------------------------------------------------------------*/
const String& SwNumFmt::GetCharFmtName() const
{
if((SwCharFmt*)GetRegisteredIn())
@@ -394,9 +336,7 @@ void SwNumFmt::ForgetCharFmt()
GetRegisteredInNonConst()->Remove( this );
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize,
const sal_Int16* pOrient)
{
@@ -404,23 +344,17 @@ void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* p
pVertOrient->SetVertOrient( *pOrient );
SvxNumberFormat::SetGraphicBrush( pBrushItem, pSize, pOrient);
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetVertOrient(sal_Int16 eSet)
{
SvxNumberFormat::SetVertOrient(eSet);
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 SwNumFmt::GetVertOrient() const
{
return SvxNumberFormat::GetVertOrient();
}
-/* -----------------------------22.02.01 13:54--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
{
sal_Bool bDocIsModified = pDoc->IsModified();
@@ -432,33 +366,6 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
for( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
if( pRule->GetNumFmt( i ) == this )
{
- // --> OD 2008-02-19 #refactorlists#
-// const String& rRuleNm = pRule->GetName();
-
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 k, nMaxItems = pDoc->GetAttrPool().GetItemCount(
-// RES_PARATR_NUMRULE );
-// for( k = 0; k < nMaxItems; ++k )
-// if( 0 != (pItem = pDoc->GetAttrPool().GetItem(
-// RES_PARATR_NUMRULE, k ) ) &&
-// 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->
-// GetDefinedIn()) &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rRuleNm )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// {
-// SwNumRuleInfo aInfo( rRuleNm );
-// pMod->GetInfo( aInfo );
-
-// for( sal_uLong nFirst = 0, nLast = aInfo.GetList().Count();
-// nFirst < nLast; ++nFirst )
-// lcl_SetRuleChgd(
-// *aInfo.GetList().GetObject( nFirst ), i );
-// }
-// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
-// lcl_SetRuleChgd( *(SwTxtNode*)pMod, i );
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
pRule->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
@@ -475,9 +382,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
if( bFnd && !bDocIsModified )
pDoc->ResetModified();
}
-/* -----------------------------31.05.01 16:08--------------------------------
- ---------------------------------------------------------------------------*/
const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const
{
sal_Int16 eOrient = SvxNumberFormat::GetVertOrient();
@@ -490,20 +395,17 @@ const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
long int SwNumRule::nInstances = 0;
#endif
-// --> OD 2008-02-11 #newlistlevelattrs#
// handle new parameter <eDefaultNumberFormatPositionAndSpaceMode>
SwNumRule::SwNumRule( const String& rNm,
const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode,
SwNumRuleType eType,
sal_Bool bAutoFlg )
: maTxtNodeList(),
- // --> OD 2008-03-03 #refactorlists#
maParagraphStyleList(),
- // <--
pNumRuleMap(0),
sName( rNm ),
eRuleType( eType ),
@@ -514,17 +416,11 @@ SwNumRule::SwNumRule( const String& rNm,
bInvalidRuleFlag( sal_True ),
bContinusNum( sal_False ),
bAbsSpaces( sal_False ),
- // --> OD 2005-10-21 - initialize member <mbCountPhantoms>
mbCountPhantoms( true ),
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
meDefaultNumberFormatPositionAndSpaceMode( eDefaultNumberFormatPositionAndSpaceMode ),
- // <--
- // --> OD 2008-04-03 #refactorlists#
msDefaultListId()
- // <--
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nSerial = nInstances++;
#endif
@@ -544,12 +440,9 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetAbsLSpace( lNumIndent + SwNumRule::GetNumIndent( n ) );
pFmt->SetFirstLineOffset( lNumFirstLineOffset );
pFmt->SetSuffix( aDotStr );
- // --> OD 2006-06-29 #b6440955#
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
- // <--
SwNumRule::aBaseFmts[ NUM_RULE ][ n ] = pFmt;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
// position-and-space mode LABEL_ALIGNMENT
// first line indent of general numbering in inch: -0,25 inch
const long cFirstLineIndent = -1440/4;
@@ -564,18 +457,15 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt = new SwNumFmt;
pFmt->SetIncludeUpperLevels( 1 );
pFmt->SetStart( 1 );
- // --> OD 2008-01-15 #newlistlevelattrs#
pFmt->SetPositionAndSpaceMode( SvxNumberFormat::LABEL_ALIGNMENT );
pFmt->SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
pFmt->SetListtabPos( cIndentAt[ n ] );
pFmt->SetFirstLineIndent( cFirstLineIndent );
pFmt->SetIndentAt( cIndentAt[ n ] );
- // <--
pFmt->SetSuffix( aDotStr );
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
SwNumRule::aLabelAlignmentBaseFmts[ NUM_RULE ][ n ] = pFmt;
}
- // <--
// outline:
// position-and-space mode LABEL_WIDTH_AND_POSITION:
@@ -586,12 +476,9 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetIncludeUpperLevels( MAXLEVEL );
pFmt->SetStart( 1 );
pFmt->SetCharTextDistance( lOutlineMinTextDistance );
- // --> OD 2006-06-29 #b6440955#
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
- // <--
SwNumRule::aBaseFmts[ OUTLINE_RULE ][ n ] = pFmt;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
// position-and-space mode LABEL_ALIGNMENT:
// indent values of default outline numbering in inch:
// 0,3 0,4 0,5 0,6 0,7
@@ -613,17 +500,14 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
SwNumRule::aLabelAlignmentBaseFmts[ OUTLINE_RULE ][ n ] = pFmt;
}
- // <--
}
memset( aFmts, 0, sizeof( aFmts ));
- ASSERT( sName.Len(), "NumRule ohne Namen!" );
+ OSL_ENSURE( sName.Len(), "NumRule ohne Namen!" );
}
SwNumRule::SwNumRule( const SwNumRule& rNumRule )
: maTxtNodeList(),
- // --> OD 2008-03-03 #refactorlists#
maParagraphStyleList(),
- // <--
pNumRuleMap(0),
sName( rNumRule.sName ),
eRuleType( rNumRule.eRuleType ),
@@ -634,17 +518,11 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
bInvalidRuleFlag( sal_True ),
bContinusNum( rNumRule.bContinusNum ),
bAbsSpaces( rNumRule.bAbsSpaces ),
- // --> OD 2005-10-21 - initialize member <mbCountPhantoms>
mbCountPhantoms( true ),
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
meDefaultNumberFormatPositionAndSpaceMode( rNumRule.meDefaultNumberFormatPositionAndSpaceMode ),
- // <--
- // --> OD 2008-04-03 #refactorlists#
msDefaultListId( rNumRule.msDefaultListId )
- // <--
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nSerial = nInstances++;
#endif
@@ -678,19 +556,15 @@ SwNumRule::~SwNumRule()
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
- // --> OD 2008-02-11 #newlistlevelattrs#
ppFmts = (SwNumFmt**)SwNumRule::aLabelAlignmentBaseFmts;
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
- // <--
}
- // --> OD 2008-02-19 #refactorlists#
maTxtNodeList.clear();
maParagraphStyleList.clear();
- // <--
}
void SwNumRule::CheckCharFmts( SwDoc* pDoc )
@@ -728,7 +602,6 @@ SwNumRule& SwNumRule::operator=( const SwNumRule& rNumRule )
return *this;
}
-
sal_Bool SwNumRule::operator==( const SwNumRule& rRule ) const
{
sal_Bool bRet = eRuleType == rRule.eRuleType &&
@@ -751,10 +624,9 @@ sal_Bool SwNumRule::operator==( const SwNumRule& rRule ) const
return bRet;
}
-
void SwNumRule::Set( sal_uInt16 i, const SwNumFmt& rNumFmt )
{
- ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
+ OSL_ENSURE( i < MAXLEVEL, "Serious defect, please inform OD" );
if( i < MAXLEVEL )
{
if( !aFmts[ i ] || !(rNumFmt == Get( i )) )
@@ -768,7 +640,7 @@ void SwNumRule::Set( sal_uInt16 i, const SwNumFmt& rNumFmt )
void SwNumRule::Set( sal_uInt16 i, const SwNumFmt* pNumFmt )
{
- ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
+ OSL_ENSURE( i < MAXLEVEL, "Serious defect, please inform OD" );
if( i >= MAXLEVEL )
return;
SwNumFmt* pOld = aFmts[ i ];
@@ -786,7 +658,6 @@ void SwNumRule::Set( sal_uInt16 i, const SwNumFmt* pNumFmt )
*pOld = *pNumFmt, bInvalidRuleFlag = sal_True;
}
-
String SwNumRule::MakeNumString( const SwNodeNum& rNum, sal_Bool bInclStrings,
sal_Bool bOnlyArabic ) const
{
@@ -807,28 +678,22 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
String aStr;
unsigned int nLevel = rNumVector.size() - 1;
- // --> OD 2005-10-17 #126238#
+
if ( nLevel > _nRestrictToThisLevel )
{
nLevel = _nRestrictToThisLevel;
}
- // <--
if (nLevel < MAXLEVEL)
{
const SwNumFmt& rMyNFmt = Get( static_cast<sal_uInt16>(nLevel) );
- // --> OD 2006-06-02 #b6432095#
- // - levels with numbering none has to provide prefix and suffix string
-// if( SVX_NUM_NUMBER_NONE != rMyNFmt.GetNumberingType() )
- // <--
+
{
sal_uInt8 i = static_cast<sal_uInt8>(nLevel);
if( !IsContinusNum() &&
- // --> OD 2006-09-19 #i69672#
// - do not include upper levels, if level isn't numbered.
rMyNFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE &&
- // <--
rMyNFmt.GetIncludeUpperLevels() ) // nur der eigene Level ?
{
sal_uInt8 n = rMyNFmt.GetIncludeUpperLevels();
@@ -880,7 +745,7 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
return aStr;
}
-// --> OD 2007-09-07 #i81002#
+
String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
const bool bInclSuperiorNumLabels,
const sal_uInt8 nRestrictInclToThisLevel ) const
@@ -940,7 +805,6 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
// eine Art Copy-Constructor, damit die Num-Formate auch an den
// richtigen CharFormaten eines Dokumentes haengen !!
// (Kopiert die NumFormate und returnt sich selbst)
-
SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
{
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -963,9 +827,7 @@ SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
bInvalidRuleFlag = sal_True;
return *this;
}
-/* -----------------30.10.98 08:33-------------------
- *
- * --------------------------------------------------*/
+
void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
{
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -978,9 +840,7 @@ void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
bInvalidRuleFlag = sal_True;
bContinusNum = rNumRule.IsContinuousNumbering();
}
-/* -----------------30.10.98 08:33-------------------
- *
- * --------------------------------------------------*/
+
SvxNumRule SwNumRule::MakeSvxNumRule() const
{
SvxNumRule aRule(NUM_CONTINUOUS|NUM_CHAR_TEXT_DISTANCE|NUM_CHAR_STYLE|
@@ -1004,19 +864,14 @@ void SwNumRule::SetInvalidRule(sal_Bool bFlag)
{
if (bFlag)
{
- // --> OD 2008-03-13 #refactorlists#
-// tPamAndNums::iterator aIt;
-// for (aIt = aNumberRanges.begin(); aIt != aNumberRanges.end(); aIt++)
-// (*aIt).second->InvalidateTree();
std::set< SwList* > aLists;
tTxtNodeList::iterator aIter;
for ( aIter = maTxtNodeList.begin(); aIter != maTxtNodeList.end(); ++aIter )
{
const SwTxtNode* pTxtNode = *aIter;
- // --> OD 2010-06-04 #i111681# - applying patch from cmc
-// aLists.insert( pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() ) );
+ // #i111681# - applying patch from cmc
SwList* pList = pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() );
- ASSERT( pList, "<SwNumRule::SetInvalidRule(..)> - list at which the text node is registered at does not exist. This is a serious issue --> please inform OD.");
+ OSL_ENSURE( pList, "<SwNumRule::SetInvalidRule(..)> - list at which the text node is registered at does not exist. This is a serious issue --> please inform OD.");
if ( pList )
{
aLists.insert( pList );
@@ -1031,71 +886,6 @@ void SwNumRule::SetInvalidRule(sal_Bool bFlag)
bInvalidRuleFlag = bFlag;
}
-// --> OD 2008-06-16 #i90078#
-// #i23725#, #i23726#
-//void SwNumRule::Indent(short nAmount, int nLevel, int nReferenceLevel,
-// sal_Bool bRelative, sal_Bool bFirstLine, sal_Bool bCheckGtZero)
-//{
-// int nStartLevel = 0;
-// int nEndLevel = MAXLEVEL - 1;
-// sal_Bool bGotInvalid = sal_False;
-
-// if (nLevel >= 0)
-// nStartLevel = nEndLevel = nLevel;
-
-// int i;
-// short nRealAmount = nAmount;
-
-// if (! bRelative)
-// {
-// if (bFirstLine)
-// {
-// if (nReferenceLevel >= 0)
-// nAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetFirstLineOffset();
-// else
-// nAmount = nAmount - Get(static_cast<sal_uInt16>(nStartLevel)).GetFirstLineOffset();
-// }
-
-// sal_Bool bFirst = sal_True;
-
-// if (nReferenceLevel >= 0)
-// nRealAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetAbsLSpace();
-// else
-// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// {
-// short nTmp = nAmount - Get(static_cast<sal_uInt16>(i)).GetAbsLSpace();
-
-// if (bFirst || nTmp > nRealAmount)
-// {
-// nRealAmount = nTmp;
-// bFirst = sal_False;
-// }
-// }
-// }
-
-// if (nRealAmount < 0)
-// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// if (Get(static_cast<sal_uInt16>(i)).GetAbsLSpace() + nRealAmount < 0)
-// nRealAmount = -Get(static_cast<sal_uInt16>(i)).GetAbsLSpace();
-
-// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// {
-// short nNew = Get(static_cast<sal_uInt16>(i)).GetAbsLSpace() + nRealAmount;
-
-// if (bCheckGtZero && nNew < 0)
-// nNew = 0;
-
-// SwNumFmt aTmpNumFmt(Get(static_cast<sal_uInt16>(i)));
-// aTmpNumFmt.SetAbsLSpace(nNew);
-
-// Set(static_cast<sal_uInt16>(i), aTmpNumFmt);
-
-// bGotInvalid = sal_True;
-// }
-
-// if (bGotInvalid)
-// SetInvalidRule(bGotInvalid);
-//}
// change indent of all list levels by given difference
void SwNumRule::ChangeIndent( const short nDiff )
@@ -1118,14 +908,13 @@ void SwNumRule::ChangeIndent( const short nDiff )
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- // --> OD 2009-01-20 #i93399#
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
const long nNewListTab = aTmpNumFmt.GetListtabPos() + nDiff;
aTmpNumFmt.SetListtabPos( nNewListTab );
}
- // <--
+
const long nNewIndent = nDiff +
aTmpNumFmt.GetIndentAt();
aTmpNumFmt.SetIndentAt( nNewIndent );
@@ -1151,7 +940,6 @@ void SwNumRule::SetIndent( const short nNewIndent,
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- // --> OD 2009-01-20 #i93399#
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
@@ -1159,7 +947,7 @@ void SwNumRule::SetIndent( const short nNewIndent,
( nNewIndent - aTmpNumFmt.GetIndentAt() );
aTmpNumFmt.SetListtabPos( nNewListTab );
}
- // <--
+
aTmpNumFmt.SetIndentAt( nNewIndent );
}
@@ -1191,14 +979,10 @@ void SwNumRule::SetIndentOfFirstListLevelAndChangeOthers( const short nNewIndent
ChangeIndent( nDiff );
}
}
-// <--
+
void SwNumRule::Validate()
{
- // --> OD 2008-03-13 #refactorlists#
-// tPamAndNums::iterator aIt;
-// for (aIt = aNumberRanges.begin(); aIt != aNumberRanges.end(); aIt++)
-// (*aIt).second->NotifyInvalidChildren();
std::set< SwList* > aLists;
tTxtNodeList::iterator aIter;
for ( aIter = maTxtNodeList.begin(); aIter != maTxtNodeList.end(); ++aIter )
@@ -1208,27 +992,30 @@ void SwNumRule::Validate()
}
std::for_each( aLists.begin(), aLists.end(),
std::mem_fun( &SwList::ValidateListTree ) );
- // <--
+
SetInvalidRule(sal_False);
}
+
bool SwNumRule::IsCountPhantoms() const
{
return mbCountPhantoms;
}
+
void SwNumRule::SetCountPhantoms(bool bCountPhantoms)
{
mbCountPhantoms = bCountPhantoms;
}
-// --> OD 2008-03-03 #refactorlists#
+
SwNumRule::tParagraphStyleList::size_type SwNumRule::GetParagraphStyleListSize() const
{
return maParagraphStyleList.size();
}
+
void SwNumRule::AddParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
{
tParagraphStyleList::iterator aIter =
@@ -1240,6 +1027,7 @@ void SwNumRule::AddParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
}
}
+
void SwNumRule::RemoveParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
{
tParagraphStyleList::iterator aIter =
@@ -1250,9 +1038,8 @@ void SwNumRule::RemoveParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
maParagraphStyleList.erase( aIter );
}
}
-// <--
-// --> OD 2006-06-27 #b6440955#
+
namespace numfunc
{
/** class containing default bullet list configuration data
@@ -1276,20 +1063,22 @@ namespace numfunc
{
return msFontname;
}
- // --> OD 2008-06-02 #i63395#
+
inline bool IsFontnameUserDefined() const
{
return mbUserDefinedFontname;
}
- // <--
+
inline const Font& GetFont() const
{
return *mpFont;
}
+
inline short GetFontWeight() const
{
return static_cast<short>(meFontWeight);
}
+
inline short GetFontItalic() const
{
return static_cast<short>(meFontItalic);
@@ -1343,9 +1132,7 @@ namespace numfunc
// default bullet list configuration data
String msFontname;
- // --> OD 2008-06-02 #i63395#
bool mbUserDefinedFontname;
- // <--
FontWeight meFontWeight;
FontItalic meFontItalic;
sal_Unicode mnLevelChars[MAXLEVEL];
@@ -1357,12 +1144,10 @@ namespace numfunc
SwDefBulletConfig* SwDefBulletConfig::mpInstance = 0;
SwDefBulletConfig::SwDefBulletConfig()
- : ConfigItem( rtl::OUString::createFromAscii("Office.Writer/Numbering/DefaultBulletList") ),
- // --> OD 2008-06-02 #i63395#
+ : ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/DefaultBulletList")) ),
// default bullet font is now OpenSymbol
msFontname( String::CreateFromAscii("OpenSymbol") ),
mbUserDefinedFontname( false ),
- // <--
meFontWeight( WEIGHT_DONTKNOW ),
meFontItalic( ITALIC_NONE ),
mpFont( 0 )
@@ -1377,27 +1162,12 @@ namespace numfunc
void SwDefBulletConfig::SetToDefault()
{
- // --> OD 2008-06-02 #i63395#
- // default bullet font name is now OpenSymbol
-// msFontname = String::CreateFromAscii("StarSymbol");
msFontname = String::CreateFromAscii("OpenSymbol");
mbUserDefinedFontname = false;
// <--
meFontWeight = WEIGHT_DONTKNOW;
meFontItalic = ITALIC_NONE;
- // --> OD 2008-06-03 #i63395#
- // new bullet characters
-// mnLevelChars[0] = 0x25cf;
-// mnLevelChars[1] = 0x25cb;
-// mnLevelChars[2] = 0x25a0;
-// mnLevelChars[3] = 0x25cf;
-// mnLevelChars[4] = 0x25cb;
-// mnLevelChars[5] = 0x25a0;
-// mnLevelChars[6] = 0x25cf;
-// mnLevelChars[7] = 0x25cb;
-// mnLevelChars[8] = 0x25a0;
-// mnLevelChars[9] = 0x25cf;
mnLevelChars[0] = 0x2022;
mnLevelChars[1] = 0x25e6;
mnLevelChars[2] = 0x25aa;
@@ -1408,26 +1178,25 @@ namespace numfunc
mnLevelChars[7] = 0x25e6;
mnLevelChars[8] = 0x25aa;
mnLevelChars[9] = 0x2022;
- // <--
}
uno::Sequence<rtl::OUString> SwDefBulletConfig::GetPropNames() const
{
uno::Sequence<rtl::OUString> aPropNames(13);
rtl::OUString* pNames = aPropNames.getArray();
- pNames[0] = rtl::OUString::createFromAscii("BulletFont/FontFamilyname");
- pNames[1] = rtl::OUString::createFromAscii("BulletFont/FontWeight");
- pNames[2] = rtl::OUString::createFromAscii("BulletFont/FontItalic");
- pNames[3] = rtl::OUString::createFromAscii("BulletCharLvl1");
- pNames[4] = rtl::OUString::createFromAscii("BulletCharLvl2");
- pNames[5] = rtl::OUString::createFromAscii("BulletCharLvl3");
- pNames[6] = rtl::OUString::createFromAscii("BulletCharLvl4");
- pNames[7] = rtl::OUString::createFromAscii("BulletCharLvl5");
- pNames[8] = rtl::OUString::createFromAscii("BulletCharLvl6");
- pNames[9] = rtl::OUString::createFromAscii("BulletCharLvl7");
- pNames[10] = rtl::OUString::createFromAscii("BulletCharLvl8");
- pNames[11] = rtl::OUString::createFromAscii("BulletCharLvl9");
- pNames[12] = rtl::OUString::createFromAscii("BulletCharLvl10");
+ pNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontFamilyname"));
+ pNames[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontWeight"));
+ pNames[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontItalic"));
+ pNames[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl1"));
+ pNames[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl2"));
+ pNames[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl3"));
+ pNames[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl4"));
+ pNames[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl5"));
+ pNames[8] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl6"));
+ pNames[9] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl7"));
+ pNames[10] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl8"));
+ pNames[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl9"));
+ pNames[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl10"));
return aPropNames;
}
@@ -1438,8 +1207,8 @@ namespace numfunc
uno::Sequence<uno::Any> aValues =
GetProperties( aPropNames );
const uno::Any* pValues = aValues.getConstArray();
- ASSERT( aValues.getLength() == aPropNames.getLength(),
- "<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed")
+ OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
+ "<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed");
if ( aValues.getLength() == aPropNames.getLength() )
{
for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
@@ -1453,9 +1222,7 @@ namespace numfunc
rtl::OUString aStr;
pValues[nProp] >>= aStr;
msFontname = aStr;
- // --> OD 2008-06-02 #i63395#
mbUserDefinedFontname = true;
- // <--
}
break;
case 1:
@@ -1517,12 +1284,10 @@ namespace numfunc
return SwDefBulletConfig::getInstance()->GetFontname();
}
- // --> OD 2008-06-02 #i63395#
bool IsDefBulletFontUserDefined()
{
return SwDefBulletConfig::getInstance()->IsFontnameUserDefined();
}
- // <--
const Font& GetDefBulletFont()
{
@@ -1536,8 +1301,6 @@ namespace numfunc
/** class containing configuration data about user interface behavior
regarding lists and list items.
-
- OD 2007-10-01 #b660435#
configuration item about behavior of <TAB>/<SHIFT-TAB>-key at first
position of first list item
@@ -1598,7 +1361,7 @@ namespace numfunc
SwNumberingUIBehaviorConfig* SwNumberingUIBehaviorConfig::mpInstance = 0;
SwNumberingUIBehaviorConfig::SwNumberingUIBehaviorConfig()
- : ConfigItem( rtl::OUString::createFromAscii("Office.Writer/Numbering/UserInterfaceBehavior") ),
+ : ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/UserInterfaceBehavior")) ),
mbChangeIndentOnTabAtFirstPosOfFirstListItem( sal_True )
{
SetToDefault();
@@ -1617,7 +1380,7 @@ namespace numfunc
{
com::sun::star::uno::Sequence<rtl::OUString> aPropNames(1);
rtl::OUString* pNames = aPropNames.getArray();
- pNames[0] = rtl::OUString::createFromAscii("ChangeIndentOnTabAtFirstPosOfFirstListItem");
+ pNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChangeIndentOnTabAtFirstPosOfFirstListItem"));
return aPropNames;
}
@@ -1630,8 +1393,8 @@ namespace numfunc
com::sun::star::uno::Sequence<com::sun::star::uno::Any> aValues =
GetProperties( aPropNames );
const com::sun::star::uno::Any* pValues = aValues.getConstArray();
- ASSERT( aValues.getLength() == aPropNames.getLength(),
- "<SwNumberingUIBehaviorConfig::LoadConfig()> - GetProperties failed")
+ OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
+ "<SwNumberingUIBehaviorConfig::LoadConfig()> - GetProperties failed");
if ( aValues.getLength() == aPropNames.getLength() )
{
for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
@@ -1647,8 +1410,7 @@ namespace numfunc
break;
default:
{
- ASSERT( false,
- "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property")
+ OSL_FAIL( "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property");
}
}
}
@@ -1668,7 +1430,6 @@ namespace numfunc
return SwNumberingUIBehaviorConfig::getInstance()->ChangeIndentOnTabAtFirstPosOfFirstListItem();
}
- // --> OD 2008-06-06 #i89178#
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
{
SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode;
@@ -1692,3 +1453,5 @@ namespace numfunc
// <--
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 961983007e2a..d51ff0a2c947 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,7 +95,7 @@ const sal_uInt16 PT_24 = 24 * 20; // 22 pt
//const sal_uInt16 HTML_PARSPACE = ((CM_05 * 7) / 10);
#define HTML_PARSPACE GetMetricVal( CM_05 )
-static const sal_Char __FAR_DATA sKomma[] = ", ";
+static const sal_Char sKomma[] = ", ";
static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = {
// PT_16, PT_14, PT_14, PT_12, PT_12, // normal
@@ -226,17 +227,15 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
{
if( !( nOutLvlBits & ( 1 << nLevel )) )
{
- //pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei
pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei
if( !bHTMLMode )
{
SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
const SwNumFmt& rNFmt = pOutlineRule->Get( nLevel );
- // --> OD 2008-02-01 #newlistlevelattrs#
+
if ( rNFmt.GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION &&
( rNFmt.GetAbsLSpace() || rNFmt.GetFirstLineOffset() ) )
- // <--
{
SvxLRSpaceItem aLR( (SvxLRSpaceItem&)pColl->GetFmtAttr( RES_LR_SPACE ) );
aLR.SetTxtFirstLineOfstValue( rNFmt.GetFirstLineOffset() );
@@ -244,7 +243,7 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
pColl->SetFmtAttr( aLR );
}
- // --> OD 2006-11-20 #i71764#
+ // #i71764#
// Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
// All paragraph styles, which are assigned to a level of the
// outline style has to have the outline style set as its list style.
@@ -301,7 +300,7 @@ void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
rSet.Put( aLR );
rSet.Put( aUL );
- if( !pColl )
+ if( pColl )
pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( nNxt ));
}
@@ -321,7 +320,7 @@ SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage)
SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
- ASSERT(
+ OSL_ENSURE(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
@@ -338,8 +337,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
return pNewColl;
}
- //if( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei
- //nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() );
+
if( pNewColl->IsAssignedToListLevelOfOutlineStyle())
nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei
}
@@ -359,7 +357,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN;
- ASSERT( nResId, "Ungueltige Pool-ID" );
+ OSL_ENSURE( nResId, "Ungueltige Pool-ID" );
if( !nResId )
return GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
@@ -390,7 +388,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
// allgemeine Inhaltsformen
case RES_POOLCOLL_STANDARD:
- /* #111214# koreans do not like SvxScriptItem(sal_True) */
+ /* koreans do not like SvxScriptItem(TRUE) */
if (bRegardLanguage)
{
sal_uLong nAppLanguage = GetAppLanguage();
@@ -971,7 +969,6 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
aLR.SetLeft( GetMetricVal( CM_1 ));
aLR.SetRight( GetMetricVal( CM_1 ));
aSet.Put( aLR );
-// aSet.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, RES_PARATR_ADJUST ) );
SvxULSpaceItem aUL( RES_UL_SPACE );
aUL = pNewColl->GetULSpace();
aUL.SetLower( HTML_PARSPACE );
@@ -1000,9 +997,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
SvxBoxItem aBox( RES_BOX );
Color aColor( COL_GRAY );
- SvxBorderLine aNew( &aColor, DEF_DOUBLE_LINE0_OUT,
- DEF_DOUBLE_LINE0_IN,
- DEF_DOUBLE_LINE0_DIST );
+ SvxBorderLine aNew( &aColor, 1, DOUBLE );
aBox.SetLine( &aNew, BOX_LINE_BOTTOM );
aSet.Put( aBox );
@@ -1050,9 +1045,6 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
{
pNewColl->SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewColl;
@@ -1064,7 +1056,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
// benutzt wird
bool SwDoc::IsPoolTxtCollUsed( sal_uInt16 nId ) const
{
- ASSERT(
+ OSL_ENSURE(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
@@ -1118,7 +1110,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
// -> returne das erste
if( RES_POOLCHR_BEGIN > nId || nId >= RES_POOLCHR_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLCHR_BEGIN;
}
}
@@ -1136,7 +1128,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
// -> returne das erste
if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLFRM_BEGIN;
}
}
@@ -1144,10 +1136,10 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
default:
// Fehlerfall, unbekanntes Format
- ASSERT( nId, "ungueltige Id" );
+ OSL_ENSURE( nId, "ungueltige Id" );
return 0;
}
- ASSERT( nRCId, "ungueltige Id" );
+ OSL_ENSURE( nRCId, "ungueltige Id" );
while( nArrCnt-- )
for( sal_uInt16 n = 0; n < (*pArray[nArrCnt]).Count(); ++n )
@@ -1211,10 +1203,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamily(),
rBulletFont.GetName(), rBulletFont.GetStyleName(),
rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
- // --> OD 2008-06-02 #i63395#
- // no font and no font size any more
-// SetAllScriptItem( aSet, SvxFontHeightItem( PT_9, 100, RES_CHRATR_FONTSIZE ));
- // <--
}
break;
@@ -1284,10 +1272,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
case RES_POOLCHR_VERT_NUM:
aSet.Put( SvxCharRotateItem( 900, sal_False, RES_CHRATR_ROTATE ) );
break;
-//nichts besonderes
-// case RES_POOLCHR_HTML_DEFINSTANCE:
-// break;
-
case RES_POOLFRM_FRAME:
{
@@ -1375,9 +1359,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
{
{
pNewFmt->SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewFmt;
@@ -1414,7 +1395,7 @@ bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const
}
else
{
- ASSERT( sal_False, "ungueltige Id" );
+ OSL_FAIL( "ungueltige Id" );
bFnd = sal_False;
}
@@ -1459,7 +1440,7 @@ void lcl_GetStdPgSize( SwDoc* pDoc, SfxItemSet& rSet )
SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
- ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
+ OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc;
@@ -1474,7 +1455,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLPAGE_BEGIN;
}
@@ -1624,9 +1605,6 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
if( bSetLeft )
pNewPgDsc->GetLeft().SetFmtAttr( aSet );
pNewPgDsc->GetMaster().SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewPgDsc;
@@ -1634,7 +1612,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
{
- ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
+ OSL_ENSURE( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
"Falsche AutoFormat-Id" );
SwNumRule* pNewRule;
@@ -1649,7 +1627,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLNUMRULE_BEGIN;
}
@@ -1658,17 +1636,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0;
- // --> OD 2008-02-11 #newlistlevelattrs#
const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
- // --> OD 2008-06-06 #i89178#
- = numfunc::GetDefaultPositionAndSpaceMode();
- // <--
+ = numfunc::GetDefaultPositionAndSpaceMode(); //#i89178#
// <--
{
sal_Bool bIsModified = IsModified();
- // --> OD 2008-02-11 #newlistlevelattrs#
+
n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode );
- // <--
+
pNewRule = GetNumRuleTbl()[ n ];
pNewRule->SetPoolFmtId( nId );
pNewRule->SetAutoRule( sal_False );
@@ -1689,9 +1664,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM1:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetStart( 1 );
@@ -1716,7 +1689,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -1726,10 +1698,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -1739,7 +1710,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -1770,22 +1741,20 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
- // <--
+
sal_uInt16 nSpace = 0;
for( n = 0; n < MAXLEVEL; ++n )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nSpace = nSpace + pArr[ n ] );
@@ -1797,7 +1766,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetIndentAt( nSpace );
aFmt.SetFirstLineIndent( - pArr[ n ] );
}
- // <--
+
aFmt.SetStart( n+1 );
pNewRule->Set( n, aFmt );
}
@@ -1806,15 +1775,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM3:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
sal_uInt16 nOffs = GetMetricVal( CM_1 ) * 3;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -1824,11 +1792,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( (n+1) * nOffs );
@@ -1838,7 +1804,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( (n+1) * nOffs );
aFmt.SetIndentAt( (n+1) * nOffs );
}
- // <--
+
aFmt.SetStart( n+1 );
pNewRule->Set( n, aFmt );
}
@@ -1847,9 +1813,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM4:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
@@ -1873,7 +1838,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -1883,11 +1847,11 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
aFmt.SetStart( n + 1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -1897,7 +1861,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -1927,21 +1891,18 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr0to2 = aAbsSpace0to2;
#endif
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm
@@ -1953,14 +1914,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[1] );
aFmt.SetIndentAt( pArr0to2[1] );
}
- // <--
aFmt.SetCharFmt( pNumCFmt );
pNewRule->Set( 0, aFmt );
aFmt.SetIncludeUpperLevels( 2 );
aFmt.SetStart( 2 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm
@@ -1972,14 +1932,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[3] );
aFmt.SetIndentAt( pArr0to2[3] );
}
- // <--
+
pNewRule->Set( 1, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER);
aFmt.SetSuffix( ')');
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetStart( 3 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm
@@ -1991,20 +1951,17 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[5] );
aFmt.SetIndentAt( pArr0to2[5] );
}
- // <--
+
pNewRule->Set( 2, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( cBulletChar );
sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4,
nOffs2 = GetMetricVal( CM_1 ) * 2;
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -2013,12 +1970,12 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
{
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
+
aFmt.SetSuffix( aEmptyStr );
for( n = 3; n < MAXLEVEL; ++n )
{
aFmt.SetStart( n+1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
@@ -2028,7 +1985,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( nOffs2 + ((n-3) * nOffs) );
aFmt.SetIndentAt( nOffs2 + ((n-3) * nOffs) );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2037,16 +1994,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL1:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( cBulletChar );
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
@@ -2067,7 +2021,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2077,10 +2030,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2090,7 +2042,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2098,16 +2050,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL2:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( 0x2013 );
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
@@ -2128,7 +2077,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2138,10 +2086,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2151,7 +2098,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2159,19 +2106,17 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL3:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
+
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -2181,12 +2126,11 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
{
aFmt.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( ((n & 1) +1) * nOffs );
@@ -2196,7 +2140,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( ((n & 1) +1) * nOffs );
aFmt.SetIndentAt( ((n & 1) +1) * nOffs );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2204,16 +2148,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL4:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
@@ -2233,7 +2174,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2243,7 +2183,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
switch( n )
@@ -2252,7 +2192,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case 1: aFmt.SetBulletChar( 0xE006 ); break;
default: aFmt.SetBulletChar( 0xE004 ); break;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2262,7 +2202,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2270,17 +2210,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL5:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetBulletChar( 0x2717 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
@@ -2300,7 +2237,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2310,10 +2246,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2323,7 +2258,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2339,7 +2274,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
// benutzt wird
bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const
{
- ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
+ OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc = 0;
sal_Bool bFnd = sal_False;
@@ -2372,36 +2307,6 @@ sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const
// erfrage ob die NumRule benutzt wird
sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
{
- // --> OD 2008-03-04 #refactorlists#
-// // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
-// // (auch indirekte fuer Format-Ableitung! )
-// sal_Bool bUsed = sal_False;
-// SwAutoFmtGetDocNode aGetHt( &aNodes );
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
-// for( i = 0; i < nMaxItems; ++i )
-// {
-// if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) &&
-// 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) &&
-// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// {
-// bUsed = !pMod->GetInfo( aGetHt );
-// if( bUsed )
-// break;
-// }
-// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
-// {
-// bUsed = sal_True;
-// break;
-// }
-// }
-// }
-
-// return bUsed;
sal_Bool bUsed = rRule.GetTxtNodeListSize() > 0 ||
rRule.GetParagraphStyleListSize() > 0;
@@ -2413,7 +2318,7 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// dann fuege neu ein
sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName )
{
- ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" );
+ OSL_ENSURE( rPatternName.Len(), "kein Dokument-Vorlagenname" );
sal_uInt16 nNewPos = aPatternNms.Count();
for( sal_uInt16 n = 0; n < aPatternNms.Count(); ++n )
@@ -2563,13 +2468,13 @@ sal_uInt16 GetPoolParent( sal_uInt16 nId )
void SwDoc::RemoveAllFmtLanguageDependencies()
{
- /* #106748# Restore the language independ pool defaults and styles. */
+ /* Restore the language independ pool defaults and styles. */
GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST );
SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST );
- /* #111214# koreans do not like SvxScriptItem(sal_True) */
+ /* koreans do not like SvxScriptItem(TRUE) */
pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE );
SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
@@ -2582,10 +2487,12 @@ void SwDoc::RemoveAllFmtLanguageDependencies()
rDesc.GetLeft().SetFmtAttr( aFrameDir );
}
- // OD 09.10.2003 #i18732# - restore static pool default for item
+ // #i18732# - restore static pool default for item
// RES_FOLLOW_TEXT_FLOW.
GetAttrPool().ResetPoolDefaultItem( RES_FOLLOW_TEXT_FLOW );
//#i16874# AutoKerning as default for new documents
GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index e845ec6f6897..eaee0fddd513 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,13 +34,11 @@
#include <i18npool/lang.h>
#include <sortopt.hxx>
-
SV_IMPL_PTRARR(SwSortKeys, SwSortKey*)
/*--------------------------------------------------------------------
Beschreibung: Sortier-Schluessel
--------------------------------------------------------------------*/
-
SwSortKey::SwSortKey() :
eSortOrder( SRT_ASCENDING ),
nColumnId( 0 ),
@@ -55,7 +54,6 @@ SwSortKey::SwSortKey(sal_uInt16 nId, const String& rSrtType, SwSortOrder eOrder)
{
}
-
SwSortKey::SwSortKey(const SwSortKey& rOld) :
sSortType( rOld.sSortType ),
eSortOrder( rOld.eSortOrder ),
@@ -67,8 +65,6 @@ SwSortKey::SwSortKey(const SwSortKey& rOld) :
/*--------------------------------------------------------------------
Beschreibung: Sortieroptionen fuers Sortieren
--------------------------------------------------------------------*/
-
-
SwSortOptions::SwSortOptions()
: eDirection( SRT_ROWS ),
cDeli( 9 ),
@@ -78,7 +74,6 @@ SwSortOptions::SwSortOptions()
{
}
-
SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
eDirection( rOpt.eDirection ),
cDeli( rOpt.cDeli ),
@@ -93,11 +88,9 @@ SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
}
}
-
SwSortOptions::~SwSortOptions()
{
aKeys.DeleteAndDestroy(0, aKeys.Count());
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index d53ac908f0c1..7290240d1151 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,9 +42,7 @@
#include <bookmrk.hxx>
#include <pam.hxx>
#include <shellio.hxx>
-#ifndef _SWERROR_H
#include <swerror.h>
-#endif
using namespace ::com::sun::star;
@@ -163,10 +162,6 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
SvLinkSource::NotifyDataChanged();
}
}
- // sonst melden wir uns ab !!
-// ????? JP 27.06.95: geht das so ????
-// else
-// Closed();
}
@@ -206,10 +201,6 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange )
SvLinkSource::NotifyDataChanged();
}
}
- // sonst melden wir uns ab !!
-// ????? JP 27.06.95: geht das so ????
-// else
-// Closed();
}
@@ -260,10 +251,6 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
// um Rekursionen zu Verhindern: ServerType umsetzen!
SwServerObject::ServerModes eSave = eType;
if( !pChkLnk )
-// sowas sollte man nicht tun, wer weiss schon, wie gross ein enum ist
-// ICC nimmt keinen int
-// #41723#
-// *((int*)&eType) = SECTION_SERVER+1;
((SwServerObject*)this)->eType = NONE_SERVER;
for( sal_uInt16 n = rLnks.Count(); n; )
{
@@ -314,8 +301,7 @@ void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark)
pDdeBookmark->SetRefObject(this);
}
else
- OSL_ENSURE(false,
- "SwServerObject::SetNoServer(..)"
+ OSL_FAIL("SwServerObject::SetNoServer(..)"
" - setting an bookmark that is not DDE-capable");
}
@@ -369,3 +355,5 @@ SwDataChanged::~SwDataChanged()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index ea8ba9366c75..5336acb92164 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include "swstylemanager.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <svl/stylepool.hxx>
#include <doc.hxx>
#include <charfmt.hxx>
@@ -38,7 +39,7 @@
#include <swtypes.hxx>
#include <istyleaccess.hxx>
-typedef ::std::hash_map< const ::rtl::OUString,
+typedef ::boost::unordered_map< const ::rtl::OUString,
StylePool::SfxItemSet_Pointer_t,
::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > SwStyleNameCache;
@@ -75,7 +76,6 @@ class SwStyleManager : public IStyleAccess
SwStyleCache *mpParaCache;
public:
- // --> OD 2008-03-07 #refactorlists#
// accept empty item set for ignorable paragraph items.
SwStyleManager( SfxItemSet* pIgnorableParagraphItems )
: aAutoCharPool(),
@@ -83,7 +83,6 @@ public:
mpCharCache(0),
mpParaCache(0)
{}
- // <--
virtual ~SwStyleManager();
virtual StylePool::SfxItemSet_Pointer_t getAutomaticStyle( const SfxItemSet& rSet,
IStyleAccess::SwAutoStyleFamily eFamily );
@@ -147,7 +146,7 @@ StylePool::SfxItemSet_Pointer_t SwStyleManager::getByName( const rtl::OUString&
{
// Ok, ok, it's allowed to ask for uncached styles (from UNO) but it should not be done
// during loading a document
- ASSERT( false, "Don't ask for uncached styles" );
+ OSL_FAIL( "Don't ask for uncached styles" );
rpCache->addCompletePool( rAutoPool );
pStyle = rpCache->getByName( rName );
}
@@ -158,10 +157,8 @@ void SwStyleManager::getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t>
IStyleAccess::SwAutoStyleFamily eFamily )
{
StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
- // --> OD 2008-03-07 #refactorlists#
// setup <StylePool> iterator, which skips unused styles and ignorable items
IStylePoolIteratorAccess *pIter = rAutoPool.createIterator( true, true );
- // <--
StylePool::SfxItemSet_Pointer_t pStyle = pIter->getNext();
while( pStyle.get() )
{
@@ -171,3 +168,5 @@ void SwStyleManager::getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t>
}
delete pIter;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swstylemanager.hxx b/sw/source/core/doc/swstylemanager.hxx
index 4997ce5c0770..486d751ba8d1 100644
--- a/sw/source/core/doc/swstylemanager.hxx
+++ b/sw/source/core/doc/swstylemanager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,9 @@
#define _SWSTYLEMANAGER_HXX
class IStyleAccess;
-// --> OD 2008-03-07 #refactorlists#
class SfxItemSet;
-// <--
-// --> OD 2008-03-07 #refactorlists#
IStyleAccess *createStyleManager( SfxItemSet* pIgnorableParagraphItems = 0 );
-// <--
#endif //_SWSTYLEMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 3d4a21584f9a..54c0348339ef 100755
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
-#endif
#define READ_OLDVERS // erstmal noch alte Versionen lesen
#include <swtypes.hxx>
@@ -73,11 +72,11 @@ const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002;
const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011;
const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012;
-// --- from 680/dr25 on: #21549# store strings as UTF-8
+// --- from 680/dr25 on: store strings as UTF-8
const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021;
const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022;
-// --- from DEV300/overline2 on: #5991# overline
+// --- from DEV300/overline2 on: overline
const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031;
const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032;
@@ -400,7 +399,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
if( 0 == rVersions.nNumFmtVersion )
{
sal_uInt16 eSys, eLge;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( sNumFmtString, eCharSet )
>> eSys >> eLge;
@@ -486,7 +485,7 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const
aRotateAngle.Store( rStream, aRotateAngle.GetVersion(SOFFICE_FILEFORMAT_40) );
aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) );
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
rStream.WriteByteString( sNumFmtString, RTL_TEXTENCODING_UTF8 )
<< (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage;
@@ -587,7 +586,7 @@ SwTableAutoFmt::~SwTableAutoFmt()
void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren
@@ -599,7 +598,7 @@ void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos ) const
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren
@@ -620,7 +619,7 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
UpdateFlags eFlags,
SvNumberFormatter* pNFmtr )
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( !pFmt ) // ist gesetzt -> kopieren
@@ -693,7 +692,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
rSet.Put( rChg.GetHeight() );
rSet.Put( rChg.GetWeight() );
rSet.Put( rChg.GetPosture() );
- // #103065# do not insert empty CJK font
+ // do not insert empty CJK font
const SvxFontItem& rCJKFont = rChg.GetCJKFont();
if( rCJKFont.GetStyleName().Len() )
{
@@ -708,7 +707,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
rSet.Put( rChg.GetWeight(), RES_CHRATR_CJK_WEIGHT );
rSet.Put( rChg.GetPosture(), RES_CHRATR_CJK_POSTURE );
}
- // #103065# do not insert empty CTL font
+ // do not insert empty CTL font
const SvxFontItem& rCTLFont = rChg.GetCTLFont();
if( rCTLFont.GetStyleName().Len() )
{
@@ -779,7 +778,7 @@ sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions
(AUTOFORMAT_DATA_ID_504 <= nVal && nVal <= AUTOFORMAT_DATA_ID)) )
{
sal_Bool b;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( aName, eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
@@ -861,7 +860,7 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const
sal_uInt16 nVal = AUTOFORMAT_DATA_ID;
sal_Bool b;
rStream << nVal;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
rStream << nStrResId;
rStream << ( b = bInclFont );
@@ -998,7 +997,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
// rStream >> nFileVers;
if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{
- ASSERT( !this, "Der Header enthaelt mehr/neuere Daten" );
+ OSL_ENSURE( !this, "Der Header enthaelt mehr/neuere Daten" );
rStream.Seek( nPos + nCnt );
}
rStream.SetStreamCharSet( (CharSet)nChrSet );
@@ -1080,9 +1079,7 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
rStream << nVal
<< (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem
<< (sal_uInt8)GetStoreCharSet( ::gsl_getSystemTextEncoding() );
-// << (sal_uInt8)4 // Anzahl von Zeichen des Headers incl. diesem
-// << (sal_uInt8)::GetSystemCharSet()
-// << (UNIT16)SOFFICE_FILEFORMAT_NOW;
+
bRet = 0 == rStream.GetError();
//-----------------------------------------------------------
@@ -1104,3 +1101,4 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 51e1d455beb5..d83bf854c645 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -142,7 +143,7 @@ namespace
for( sal_uInt16 nLine = 0; nLine < rBox.GetTabLines().Count(); ++nLine )
pStartLn = insertSubLine( rSubTable, *rBox.GetTabLines()[nLine],
pStartLn );
- ASSERT( pStartLn == pEndLn, "Sub line confusion" );
+ OSL_ENSURE( pStartLn == pEndLn, "Sub line confusion" );
}
else
{
@@ -507,19 +508,6 @@ namespace
if( pBox && pBox->getRowSpan() > 0 )
lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
sal_True, pUndo );
- /* Idea: If target cell is a covered cell, append content
- to master cell.
- sal_Bool bReplace = sal_True;
- if( pBox->getRowSpan() < 0 )
- {
- if( rInfo.mpCopy->getRowSpan() < 0 )
- continue;
- pBox = &pBox->FindStartOfRowSpan( rDstTbl );
- bReplace = sal_False;
- }
- lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
- bReplace, pUndo );
- */
}
}
}
@@ -541,7 +529,7 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwTable& rDstTbl, SwTableBox* pDstBox,
sal_Bool bDelCntnt, SwUndoTblCpyTbl* pUndo )
{
- ASSERT( ( !pCpyBox || pCpyBox->GetSttNd() ) && pDstBox->GetSttNd(),
+ OSL_ENSURE( ( !pCpyBox || pCpyBox->GetSttNd() ) && pDstBox->GetSttNd(),
"Keine inhaltstragende Box" );
SwDoc* pCpyDoc = rCpyTbl.GetFrmFmt()->GetDoc();
@@ -616,7 +604,6 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
}
if( pCNd &&
- /*RES_POOLCOLL_TABLE == */
RES_POOLCOLL_TABLE_HDLN !=
pCNd->GetFmtColl()->GetPoolFmtId() )
bReplaceColl = sal_False;
@@ -748,8 +735,6 @@ sal_Bool SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBox
return sal_True;
}
-// ---------------------------------------------------------------
-
// kopiere die Tabelle in diese.
// Kopiere alle Boxen einer Line in entsprechenden Boxen. Der alte Inhalt
// wird dabei geloescht.
@@ -757,8 +742,6 @@ sal_Bool SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBox
// Box einer "GrundLine".
// Ist auch keine Line mehr vorhanden, -> auch in die letzte Box
// einer "GrundLine"
-
-
sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwUndoTblCpyTbl* pUndo )
{
@@ -772,7 +755,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwTableBox* pMyBox = (SwTableBox*)GetTblBox(
rSttBox.GetNode().FindTableBoxStartNode()->GetIndex() );
- ASSERT( pMyBox, "Index steht nicht in dieser Tabelle in einer Box" );
+ OSL_ENSURE( pMyBox, "Index steht nicht in dieser Tabelle in einer Box" );
// loesche erstmal die Frames der Tabelle
_FndBox aFndBox( 0, 0 );
@@ -839,18 +822,17 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
return sal_True;
}
-
sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwUndoTblCpyTbl* pUndo )
{
- ASSERT( rSelBoxes.Count(), "Missing selection" )
+ OSL_ENSURE( rSelBoxes.Count(), "Missing selection" );
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
if( IsNewModel() || rCpyTbl.IsNewModel() )
return InsNewTable( rCpyTbl, rSelBoxes, pUndo );
- ASSERT( !rCpyTbl.IsTblComplex(), "Table too complex" )
+ OSL_ENSURE( !rCpyTbl.IsTblComplex(), "Table too complex" );
SwDoc* pDoc = GetFrmFmt()->GetDoc();
SwDoc* pCpyDoc = rCpyTbl.GetFrmFmt()->GetDoc();
@@ -926,7 +908,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// es ist also Platz fuer das zu kopierende vorhanden, also
// fuege entsprechend neue Zeilen ein.
SwTableBox* pInsBox = pLastLn->GetTabBoxes()[ nSttBox ];
- ASSERT( pInsBox && pInsBox->GetSttNd(),
+ OSL_ENSURE( pInsBox && pInsBox->GetSttNd(),
"kein CntntBox oder steht nicht in dieser Tabelle" );
SwSelBoxes aBoxes;
@@ -1061,8 +1043,6 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
return sal_True;
}
-
-
sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
{
SwTableBox* pBox = (SwTableBox*)rpBox;
@@ -1073,14 +1053,12 @@ sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
return sal_True;
}
-
sal_Bool _FndCntntLine( const SwTableLine*& rpLine, void* pPara )
{
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &_FndCntntBox, pPara );
return sal_True;
}
-
// suche alle Inhaltstragenden-Boxen dieser Box
SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
SwSelBoxes& rBoxes, sal_Bool bToTop ) const
@@ -1096,4 +1074,4 @@ SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
return rBoxes;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index a71c0e170834..5cdc3d5dc850 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,15 +74,11 @@ using namespace com::sun::star::uno;
using namespace ::com::sun::star;
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 2
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
typedef SwTableLine* SwTableLinePtr;
SV_DECL_PTRARR_SORT( SwSortTableLines, SwTableLinePtr, 16, 16 )
@@ -196,7 +193,7 @@ sal_Bool lcl_DelOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
typedef sal_Bool (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, sal_Bool );
-#if defined(DBG_UTIL) || defined( JP_DEBUG )
+#if OSL_DEBUG_LEVEL > 1
void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
@@ -217,8 +214,8 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
{ \
if ( pFrm->GetTabLine() == GetTabLines()[i] ) \
{ \
- ASSERT( pFrm->GetUpper()->IsTabFrm(), \
- "Table layout does not match table structure" ) \
+ OSL_ENSURE( pFrm->GetUpper()->IsTabFrm(), \
+ "Table layout does not match table structure" ); \
} \
} \
} \
@@ -231,7 +228,6 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
#endif
-
struct CR_SetLineHeight
{
SwSelBoxes aBoxes;
@@ -289,8 +285,6 @@ SV_IMPL_VARARR_SORT( _CpyTabFrms, _CpyTabFrm )
void lcl_DelCpyTabFrmFmts( _CpyTabFrm& rArr );
-// ---------------------------------------------------------------
-
struct _CpyPara
{
boost::shared_ptr< std::vector< std::vector< sal_uLong > > > pWidths;
@@ -334,7 +328,6 @@ struct _CpyPara
void SetBoxWidth( SwTableBox* pBox );
};
-
sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
@@ -396,7 +389,6 @@ sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
else
{
aFindFrm = pCpyPara->rTabFrmArr[ nFndPos ];
-// aFindFrm.pNewFrmFmt->Add( pBox );
pBox->ChgFrmFmt( (SwTableBoxFmt*)aFindFrm.pNewFrmFmt );
}
}
@@ -488,8 +480,6 @@ sal_Bool lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara )
return sal_True;
}
-//-----------------------------------------------------------
-
void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, sal_uInt16 nCpyCnt,
sal_Bool bBehind )
{
@@ -532,10 +522,9 @@ SwRowFrm* GetRowFrm( SwTableLine& rLine )
return 0;
}
-
sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
- ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -575,8 +564,8 @@ sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 n
//Layout updaten
aFndBox.MakeFrms( *this );
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
bRes = sal_True;
}
@@ -591,7 +580,7 @@ sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 n
sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
sal_uInt16 nCnt, sal_Bool bBehind )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -676,8 +665,8 @@ sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
aFndBox.MakeNewFrms( *this, nCnt, bBehind );
}
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
if (pPCD && nCnt)
@@ -722,7 +711,6 @@ sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
return sal_True;
}
-
sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
{
SwTableNode* pTblNd = (SwTableNode*)aSortCntBoxes[0]->GetSttNd()->FindTableNode();
@@ -776,13 +764,12 @@ sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
// TL_CHART2: need to inform chart of probably changed cell names
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
return sal_True;
}
-
void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
sal_Bool bFirst, SwShareBoxFmts& rShareFmts );
@@ -1083,7 +1070,6 @@ void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
}
}
-
sal_Bool SwTable::DeleteSel(
SwDoc* pDoc
,
@@ -1091,7 +1077,7 @@ sal_Bool SwTable::DeleteSel(
const SwSelBoxes* pMerged, SwUndo* pUndo,
const sal_Bool bDelMakeFrms, const sal_Bool bCorrBorder )
{
- ASSERT( pDoc, "No doc?" );
+ OSL_ENSURE( pDoc, "No doc?" );
SwTableNode* pTblNd = 0;
if( rBoxes.Count() )
{
@@ -1153,19 +1139,16 @@ sal_Bool SwTable::DeleteSel(
// TL_CHART2: now inform chart that sth has changed
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
- CHECKTABLELAYOUT
- CHECK_TABLE( *this )
+ CHECKTABLELAYOUT;
+ CHECK_TABLE( *this );
return sal_True;
}
-
-// ---------------------------------------------------------------
-
sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
sal_Bool bSameHeight )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1187,7 +1170,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
const SwRowFrm* pRow = GetRowFrm( *pSelBox->GetUpper() );
- ASSERT( pRow, "wo ist der Frm von der SwTableLine?" )
+ OSL_ENSURE( pRow, "wo ist der Frm von der SwTableLine?" );
SWRECTFN( pRow )
pRowHeights[ n ] = (pRow->Frm().*fnRect->fnGetHeight)();
}
@@ -1201,7 +1184,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
- ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
+ OSL_ENSURE( pSelBox, "Box steht nicht in der Tabelle" );
// dann fuege in die Box nCnt neue Zeilen ein
SwTableLine* pInsLine = pSelBox->GetUpper();
@@ -1308,7 +1291,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1334,7 +1317,7 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( aSelBoxes.GetData() + n );
- ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
+ OSL_ENSURE( pSelBox, "Box steht nicht in der Tabelle" );
// We don't want to split small table cells into very very small cells
if( pSelBox->GetFrmFmt()->GetFrmSize().GetWidth()/( nCnt + 1 ) < 10 )
@@ -1416,8 +1399,6 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
return sal_True;
}
-// ---------------------------------------------------------------
-
/*
----------------------- >> MERGE << ------------------------
Algorithmus:
@@ -1432,7 +1413,6 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
----------------------- >> MERGE << ------------------------
*/
-
void lcl_CpyLines( sal_uInt16 nStt, sal_uInt16 nEnd,
SwTableLines& rLines,
SwTableBox* pInsBox,
@@ -1463,10 +1443,10 @@ void lcl_CalcWidth( SwTableBox* pBox )
{
// Annahme: jede Line in der Box ist gleich gross
SwFrmFmt* pFmt = pBox->ClaimFrmFmt();
- ASSERT( pBox->GetTabLines().Count(), "Box hat keine Lines" );
+ OSL_ENSURE( pBox->GetTabLines().Count(), "Box hat keine Lines" );
SwTableLine* pLine = pBox->GetTabLines()[0];
- ASSERT( pLine, "Box steht in keiner Line" );
+ OSL_ENSURE( pLine, "Box steht in keiner Line" );
long nWidth = 0;
for( sal_uInt16 n = 0; n < pLine->GetTabBoxes().Count(); ++n )
@@ -1479,8 +1459,6 @@ void lcl_CalcWidth( SwTableBox* pBox )
pFmt->ResetFmtAttr( RES_BOXATR_BEGIN, RES_BOXATR_END - 1 );
}
-
-
struct _InsULPara
{
SwTableNode* pTblNd;
@@ -1510,7 +1488,6 @@ struct _InsULPara
{ bUL_LR = sal_True; bUL = sal_False; if( pLine ) pInsLine = pLine; }
};
-
sal_Bool lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara )
{
_InsULPara* pULPara = (_InsULPara*)pPara;
@@ -1591,8 +1568,6 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
sal_uInt16 nLeft = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pLBx );
sal_uInt16 nRight = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pRBx );
-// if( ( nLeft && nRight+1 < pFndLn->GetTabBoxes().Count() ) ||
-// ( !nLeft && nRight+1 >= pFndLn->GetTabBoxes().Count() ) )
if( !nLeft || nRight == pFndLn->GetTabBoxes().Count() )
{
if( pULPara->bUL ) // Upper ?
@@ -1722,7 +1697,7 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
lcl_CalcWidth( pRMBox ); // bereche die Breite der Box
}
else {
- ASSERT( sal_False , "Was denn nun" );
+ OSL_FAIL( "Was denn nun" );
}
}
// Left/Right
@@ -1752,11 +1727,10 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
return sal_True;
}
-
sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo )
{
- ASSERT( rBoxes.Count() && pMergeBox, "keine gueltigen Werte" );
+ OSL_ENSURE( rBoxes.Count() && pMergeBox, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1863,8 +1837,6 @@ sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return sal_True;
}
-// ---------------------------------------------------------------
-
void lcl_CheckRowSpan( SwTable &rTbl )
{
sal_uInt16 nLineCount = rTbl.GetTabLines().Count();
@@ -2219,11 +2191,11 @@ sal_Bool SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
{ // The copied line must not contain any row span attributes > 1
SwTableLine* pLine = rTblNd.GetTable().GetTabLines()[0];
sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
- ASSERT( nColCount, "Empty Table Line" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pTableBox = pLine->GetTabBoxes()[nCurrCol];
- ASSERT( pTableBox, "Missing Table Box" );
+ OSL_ENSURE( pTableBox, "Missing Table Box" );
pTableBox->setRowSpan( 1 );
}
}
@@ -2263,7 +2235,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwNodeIndex aIdx( rPos.nNode, -1 );
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
aIdx++;
- ASSERT( pTblNd, "wo ist denn nun der TableNode?" );
+ OSL_ENSURE( pTblNd, "wo ist denn nun der TableNode?" );
pTblNd->GetTable().SetRowsToRepeat( GetRowsToRepeat() );
@@ -2273,7 +2245,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
// ist im neuen Dokument ueberhaupt der FeldTyp vorhanden ?
SwFieldType* pFldType = pInsDoc->InsertFldType(
*((SwDDETable*)this)->GetDDEFldType() );
- ASSERT( pFldType, "unbekannter FieldType" );
+ OSL_ENSURE( pFldType, "unbekannter FieldType" );
// tauschen am Node den Tabellen-Pointer aus
pNewTbl = new SwDDETable( *pNewTbl,
@@ -2371,10 +2343,6 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
return sal_True;
}
-
-
-// ---------------------------------------------------------------
-
// suche ab dieser Line nach der naechsten Box mit Inhalt
SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
@@ -2395,7 +2363,7 @@ SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
if( GetUpper() )
{
nFndPos = GetUpper()->GetTabLines().GetPos( pLine );
- ASSERT( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
// gibts eine weitere Line
if( nFndPos+1 >= GetUpper()->GetTabLines().Count() )
return GetUpper()->GetUpper()->FindNextBox( rTbl, GetUpper(), bOvrTblLns );
@@ -2446,7 +2414,7 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
if( GetUpper() )
{
nFndPos = GetUpper()->GetTabLines().GetPos( pLine );
- ASSERT( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
// gibts eine weitere Line
if( !nFndPos )
return GetUpper()->GetUpper()->FindPreviousBox( rTbl, GetUpper(), bOvrTblLns );
@@ -2498,7 +2466,6 @@ SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
bOvrTblLns );
}
-
sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
{
// in der HeadLine sind die Absaetze mit BedingtenVorlage anzupassen
@@ -2516,8 +2483,6 @@ sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* )
return sal_True;
}
-/* */
-
SwTwips lcl_GetDistance( SwTableBox* pBox, sal_Bool bLeft )
{
sal_Bool bFirst = sal_True;
@@ -2736,8 +2701,6 @@ sal_Bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
return sal_True;
}
-/* */
-
sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
SwTwips nDist, sal_Bool bCheck )
{
@@ -2821,7 +2784,7 @@ sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
}
else
{
- ASSERT( pBox->GetSttNd(), "Das muss eine EndBox sein!");
+ OSL_ENSURE( pBox->GetSttNd(), "Das muss eine EndBox sein!");
if( !rParam.bLeft && 3 != nCmp )
++n;
@@ -2920,8 +2883,8 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
(n < rBoxes.Count() &&
- (nDist + nWidth + rBoxes[ n+1 ]->
- GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+ (nDist + nWidth + rBoxes[ n+1 ]->
+ GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide
)
@@ -2985,8 +2948,8 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
(rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
(n < rBoxes.Count() &&
- (nDist + nWidth + rBoxes[ n+1 ]->
- GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+ (nDist + nWidth + rBoxes[ n+1 ]->
+ GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide ))
{
@@ -3022,7 +2985,6 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
return sal_True;
}
-
// das Ergebnis des Positions Vergleiches
// POS_BEFORE, // Box liegt davor
// POS_BEHIND, // Box liegt dahinter
@@ -3031,7 +2993,6 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
// POS_EQUAL, // Box und Start/End sind gleich
// POS_OVERLAP_BEFORE, // Box ueberlappt den Start
// POS_OVERLAP_BEHIND // Box ueberlappt das Ende
-
SwComparePosition _CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd,
sal_uInt16 nBoxStt, sal_uInt16 nBoxEnd )
{
@@ -3424,7 +3385,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
break;
default:
- ASSERT( !pBox, "hier sollte man nie hinkommen" );
+ OSL_ENSURE( !pBox, "hier sollte man nie hinkommen" );
break;
}
}
@@ -3477,8 +3438,6 @@ sal_Bool lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , sal_Bool )
return sal_True;
}
-/* */
-
void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
@@ -3498,7 +3457,7 @@ void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
}
}
-#if defined(DBG_UTIL) || defined( JP_DEBUG )
+#if OSL_DEBUG_LEVEL > 1
void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
{
@@ -3518,10 +3477,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
if( Abs( nAktSize - nSize ) > ( COLFUZZY * rBoxes.Count() ) )
{
- DBG_ERROR( "Boxen der Line zu klein/gross" );
-#if defined( WNT ) && defined( JP_DEBUG )
- __asm int 3;
-#endif
+ OSL_FAIL( "Boxen der Line zu klein/gross" );
}
}
@@ -3556,7 +3512,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetBoxWidth& rParam, SwUndo** ppUndo,
{
_FndPara aPara( rParam.aBoxes, pFndBox );
rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
- ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
+ OSL_ENSURE( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
if( ppUndo )
@@ -4065,7 +4021,6 @@ sal_Bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
return bRet;
}
-/* */
_FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
SwTableSortBoxes& rTmpLst )
@@ -4073,7 +4028,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
// suche alle Boxen / Lines
SwTable& rTbl = rParam.pTblNd->GetTable();
- ASSERT( rParam.aBoxes.Count(), "ohne Boxen ist nichts zu machen!" );
+ OSL_ENSURE( rParam.aBoxes.Count(), "ohne Boxen ist nichts zu machen!" );
// loeschen der gesamten Tabelle verhindern
if( !rParam.bBigger && rParam.aBoxes.Count() ==
@@ -4087,7 +4042,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
{
_FndPara aPara( rParam.aBoxes, pFndBox );
rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
- ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
+ OSL_ENSURE( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
if( ppUndo )
@@ -4106,7 +4061,7 @@ void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight,
sal_Bool bMinSize )
{
SwLayoutFrm* pLineFrm = GetRowFrm( rLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
SwFrmFmt* pFmt = rLine.ClaimFrmFmt();
@@ -4153,7 +4108,7 @@ sal_Bool lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// anhand der alten Size die neue relative errechnen
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
SwTwips nRstHeight = CalcRowRstHeight( pLineFrm );
if( (nRstHeight + ROWFUZZY) < nDist )
bRet = sal_False;
@@ -4171,7 +4126,7 @@ sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// anhand der alten Size die neue relative errechnen
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
if( TBLFIX_CHGPROP == rParam.nMode )
{
@@ -4188,7 +4143,7 @@ sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
if( TBLFIX_CHGPROP == rParam.nMode )
{
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
// aus der alten Size die neue relative errechnen
// Wird die selektierte Box groesser ueber den MaxSpace anpassen,
@@ -4397,8 +4352,7 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
- // #110525# delete complete table when last row is
- // deleted
+ // delete complete table when last row is deleted
if( !bBigger &&
aParam.aBoxes.Count() == aSortCntBoxes.Count() )
{
@@ -4434,7 +4388,7 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
for( n = nStt; n < nEnd; ++n )
{
SwLayoutFrm* pLineFrm = GetRowFrm( *(*pLines)[ n ] );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
aParam.nMaxSpace += CalcRowRstHeight( pLineFrm );
aParam.nMaxHeight += pLineFrm->Frm().Height();
}
@@ -4562,8 +4516,6 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
return bRet;
}
-/* */
-
SwFrmFmt* SwShareBoxFmt::GetFormat( long nWidth ) const
{
SwFrmFmt *pRet = 0, *pTmp;
@@ -4635,10 +4587,6 @@ SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt,
void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
{
- // wenn das Format nicht geshared ist, braucht es auch nicht in die
- // Liste aufgenommen werden. Denn es gibt keinen 2. der es sucht.
-//leider werden auch die CellFrms gefunden
-// if( !rOld.IsLastDepend() )
{
sal_uInt16 nPos;
SwShareBoxFmt* pEntry;
@@ -4653,6 +4601,7 @@ void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
pEntry->AddFormat( rNew );
}
}
+
void SwShareBoxFmts::ChangeFrmFmt( SwTableBox* pBox, SwTableLine* pLn,
SwFrmFmt& rFmt )
{
@@ -4760,4 +4709,4 @@ sal_Bool SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, sal_uInt16* pPos ) co
return sal_False;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 01b4623fba96..b269451ac512 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,3 +138,4 @@ sal_Bool SwDoc::IsVisitedURL( const String& rURL ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */