xref: /aoo41x/main/sw/source/core/doc/dbgoutsw.cxx (revision 721ad428)
1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5efeef26fSAndrew Rist  * distributed with this work for additional information
6efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10efeef26fSAndrew Rist  *
11efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12efeef26fSAndrew Rist  *
13efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17efeef26fSAndrew Rist  * specific language governing permissions and limitations
18efeef26fSAndrew Rist  * under the License.
19efeef26fSAndrew Rist  *
20efeef26fSAndrew Rist  *************************************************************/
21efeef26fSAndrew Rist 
22efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir #ifdef DEBUG
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <tools/string.hxx>
29cdf0e10cSrcweir #include <svl/poolitem.hxx>
30cdf0e10cSrcweir #include <svl/itemiter.hxx>
31cdf0e10cSrcweir #include <string>
32cdf0e10cSrcweir #include <map>
33cdf0e10cSrcweir #include <node.hxx>
34cdf0e10cSrcweir #include <ndtxt.hxx>
35cdf0e10cSrcweir #include <ndhints.hxx>
36cdf0e10cSrcweir #include <txatbase.hxx>
37cdf0e10cSrcweir #include <pam.hxx>
38cdf0e10cSrcweir #include <docary.hxx>
39cdf0e10cSrcweir #include <swundo.hxx>
40cdf0e10cSrcweir #include <undobj.hxx>
41cdf0e10cSrcweir #include <numrule.hxx>
42cdf0e10cSrcweir #include <doc.hxx>
43cdf0e10cSrcweir #include <frmfmt.hxx>
44cdf0e10cSrcweir #include <fmtanchr.hxx>
45cdf0e10cSrcweir #include <swrect.hxx>
46cdf0e10cSrcweir #include <ndarr.hxx>
47cdf0e10cSrcweir #include <paratr.hxx>
48cdf0e10cSrcweir #include <SwNodeNum.hxx>
49cdf0e10cSrcweir #include <dbgoutsw.hxx>
50cdf0e10cSrcweir #include <SwRewriter.hxx>
51cdf0e10cSrcweir #include <iostream>
52cdf0e10cSrcweir #include <cstdio>
53cdf0e10cSrcweir 
54cdf0e10cSrcweir using namespace std;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir static ByteString aDbgOutResult;
57cdf0e10cSrcweir bool bDbgOutStdErr = false;
58cdf0e10cSrcweir bool bDbgOutPrintAttrSet = false;
59cdf0e10cSrcweir 
db_pretty_print(const String * str,int flags,char * fmt)60cdf0e10cSrcweir char* db_pretty_print(const String* str, int flags, char* fmt)
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     (void) fmt;
63cdf0e10cSrcweir     (void) flags;
64cdf0e10cSrcweir     return const_cast<char*>(dbg_out(*str));
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir template<class T>
lcl_dbg_out_SvPtrArr(const T & rArr)68cdf0e10cSrcweir String lcl_dbg_out_SvPtrArr(const T & rArr)
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     for (sal_Int16 n = 0; n < rArr.Count(); n++)
73cdf0e10cSrcweir     {
74cdf0e10cSrcweir         if (n > 0)
75cdf0e10cSrcweir             aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir         if (rArr[n])
78cdf0e10cSrcweir             aStr += lcl_dbg_out(*rArr[n]);
79cdf0e10cSrcweir         else
80cdf0e10cSrcweir             aStr += String("(null)", RTL_TEXTENCODING_ASCII_US);
81cdf0e10cSrcweir     }
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     return aStr;
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
dbg_out(const void * pVoid)88cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const void * pVoid)
89cdf0e10cSrcweir {
90cdf0e10cSrcweir     char sBuffer[1024];
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     sprintf(sBuffer, "%p", pVoid);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     String aTmpStr(sBuffer, RTL_TEXTENCODING_ASCII_US);
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     return dbg_out(aTmpStr);
97cdf0e10cSrcweir }
98cdf0e10cSrcweir 
dbg_out(const String & aStr)99cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const String & aStr)
100cdf0e10cSrcweir {
101cdf0e10cSrcweir     aDbgOutResult = ByteString(aStr, RTL_TEXTENCODING_ASCII_US);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     if (bDbgOutStdErr)
104cdf0e10cSrcweir         fprintf(stderr, "%s", aDbgOutResult.GetBuffer());
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     return aDbgOutResult.GetBuffer();
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
dbg_out(const::rtl::OUString & aStr)109cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
110cdf0e10cSrcweir {
111cdf0e10cSrcweir     return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr();
112cdf0e10cSrcweir }
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 
115cdf0e10cSrcweir struct CompareUShort
116cdf0e10cSrcweir {
operator ()CompareUShort117cdf0e10cSrcweir     bool operator()(sal_uInt16 a, sal_uInt16 b) const
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir         return a < b;
120cdf0e10cSrcweir     }
121cdf0e10cSrcweir };
122cdf0e10cSrcweir 
GetItemWhichMap()123cdf0e10cSrcweir map<sal_uInt16,String,CompareUShort> & GetItemWhichMap()
124cdf0e10cSrcweir {
125cdf0e10cSrcweir     static map<sal_uInt16,String,CompareUShort> aItemWhichMap;
126cdf0e10cSrcweir     static bool bInitialized = false;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     if (! bInitialized)
129cdf0e10cSrcweir     {
130cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CASEMAP] = String("CHRATR_CASEMAP", RTL_TEXTENCODING_ASCII_US);
131cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CHARSETCOLOR] = String("CHRATR_CHARSETCOLOR", RTL_TEXTENCODING_ASCII_US);
132cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_COLOR] = String("CHRATR_COLOR", RTL_TEXTENCODING_ASCII_US);
133cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CONTOUR] = String("CHRATR_CONTOUR", RTL_TEXTENCODING_ASCII_US);
134cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CROSSEDOUT] = String("CHRATR_CROSSEDOUT", RTL_TEXTENCODING_ASCII_US);
135cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_ESCAPEMENT] = String("CHRATR_ESCAPEMENT", RTL_TEXTENCODING_ASCII_US);
136cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_FONT] = String("CHRATR_FONT", RTL_TEXTENCODING_ASCII_US);
137cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_FONTSIZE] = String("CHRATR_FONTSIZE", RTL_TEXTENCODING_ASCII_US);
138cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_KERNING] = String("CHRATR_KERNING", RTL_TEXTENCODING_ASCII_US);
139cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_LANGUAGE] = String("CHRATR_LANGUAGE", RTL_TEXTENCODING_ASCII_US);
140cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_POSTURE] = String("CHRATR_POSTURE", RTL_TEXTENCODING_ASCII_US);
141cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_PROPORTIONALFONTSIZE] = String("CHRATR_PROPORTIONALFONTSIZE", RTL_TEXTENCODING_ASCII_US);
142cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_SHADOWED] = String("CHRATR_SHADOWED", RTL_TEXTENCODING_ASCII_US);
143cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_UNDERLINE] = String("CHRATR_UNDERLINE", RTL_TEXTENCODING_ASCII_US);
144cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_OVERLINE] = String("CHRATR_OVERLINE", RTL_TEXTENCODING_ASCII_US);
145cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_WEIGHT] = String("CHRATR_WEIGHT", RTL_TEXTENCODING_ASCII_US);
146cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_WORDLINEMODE] = String("CHRATR_WORDLINEMODE", RTL_TEXTENCODING_ASCII_US);
147cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_AUTOKERN] = String("CHRATR_AUTOKERN", RTL_TEXTENCODING_ASCII_US);
148cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_BLINK] = String("CHRATR_BLINK", RTL_TEXTENCODING_ASCII_US);
149cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_NOHYPHEN] = String("CHRATR_NOHYPHEN", RTL_TEXTENCODING_ASCII_US);
150cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_NOLINEBREAK] = String("CHRATR_NOLINEBREAK", RTL_TEXTENCODING_ASCII_US);
151cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_BACKGROUND] = String("CHRATR_BACKGROUND", RTL_TEXTENCODING_ASCII_US);
152cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CJK_FONT] = String("CHRATR_CJK_FONT", RTL_TEXTENCODING_ASCII_US);
153cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CJK_FONTSIZE] = String("CHRATR_CJK_FONTSIZE", RTL_TEXTENCODING_ASCII_US);
154cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CJK_LANGUAGE] = String("CHRATR_CJK_LANGUAGE", RTL_TEXTENCODING_ASCII_US);
155cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CJK_POSTURE] = String("CHRATR_CJK_POSTURE", RTL_TEXTENCODING_ASCII_US);
156cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CJK_WEIGHT] = String("CHRATR_CJK_WEIGHT", RTL_TEXTENCODING_ASCII_US);
157cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CTL_FONT] = String("CHRATR_CTL_FONT", RTL_TEXTENCODING_ASCII_US);
158cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CTL_FONTSIZE] = String("CHRATR_CTL_FONTSIZE", RTL_TEXTENCODING_ASCII_US);
159cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CTL_LANGUAGE] = String("CHRATR_CTL_LANGUAGE", RTL_TEXTENCODING_ASCII_US);
160cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CTL_POSTURE] = String("CHRATR_CTL_POSTURE", RTL_TEXTENCODING_ASCII_US);
161cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_CTL_WEIGHT] = String("CHRATR_CTL_WEIGHT", RTL_TEXTENCODING_ASCII_US);
162cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_ROTATE] = String("CHRATR_ROTATE", RTL_TEXTENCODING_ASCII_US);
163cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_EMPHASIS_MARK] = String("CHRATR_EMPHASIS_MARK", RTL_TEXTENCODING_ASCII_US);
164cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_TWO_LINES] = String("CHRATR_TWO_LINES", RTL_TEXTENCODING_ASCII_US);
165cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_SCALEW] = String("CHRATR_SCALEW", RTL_TEXTENCODING_ASCII_US);
166cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_RELIEF] = String("CHRATR_RELIEF", RTL_TEXTENCODING_ASCII_US);
167cdf0e10cSrcweir         aItemWhichMap[RES_CHRATR_HIDDEN] = String("CHRATR_HIDDEN", RTL_TEXTENCODING_ASCII_US);
168cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_AUTOFMT] = String("TXTATR_AUTOFMT", RTL_TEXTENCODING_ASCII_US);
169cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_INETFMT] = String("TXTATR_INETFMT", RTL_TEXTENCODING_ASCII_US);
170cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_REFMARK] = String("TXTATR_REFMARK", RTL_TEXTENCODING_ASCII_US);
171cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_TOXMARK] = String("TXTATR_TOXMARK", RTL_TEXTENCODING_ASCII_US);
172cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_CHARFMT] = String("TXTATR_CHARFMT", RTL_TEXTENCODING_ASCII_US);
17369a74367SOliver-Rainer Wittmann         aItemWhichMap[RES_TXTATR_INPUTFIELD] = String("TXTATR_INPUTFIELD", RTL_TEXTENCODING_ASCII_US);
174cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_CJK_RUBY] = String("TXTATR_CJK_RUBY", RTL_TEXTENCODING_ASCII_US);
175cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_UNKNOWN_CONTAINER] = String("TXTATR_UNKNOWN_CONTAINER", RTL_TEXTENCODING_ASCII_US);
176cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_META] = String("TXTATR_META", RTL_TEXTENCODING_ASCII_US);
177cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_METAFIELD] = String("TXTATR_METAFIELD", RTL_TEXTENCODING_ASCII_US);
178cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_FIELD] = String("TXTATR_FIELD", RTL_TEXTENCODING_ASCII_US);
179cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_FLYCNT] = String("TXTATR_FLYCNT", RTL_TEXTENCODING_ASCII_US);
180cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_FTN] = String("TXTATR_FTN", RTL_TEXTENCODING_ASCII_US);
181dec99bbdSOliver-Rainer Wittmann         aItemWhichMap[RES_TXTATR_ANNOTATION] = String("TXTATR_ANNOTATION", RTL_TEXTENCODING_ASCII_US);
182cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_DUMMY3] = String("TXTATR_DUMMY3", RTL_TEXTENCODING_ASCII_US);
183cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_DUMMY1] = String("TXTATR_DUMMY1", RTL_TEXTENCODING_ASCII_US);
184cdf0e10cSrcweir         aItemWhichMap[RES_TXTATR_DUMMY2] = String("TXTATR_DUMMY2", RTL_TEXTENCODING_ASCII_US);
185cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_LINESPACING] = String("PARATR_LINESPACING", RTL_TEXTENCODING_ASCII_US);
186cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_ADJUST] = String("PARATR_ADJUST", RTL_TEXTENCODING_ASCII_US);
187cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_SPLIT] = String("PARATR_SPLIT", RTL_TEXTENCODING_ASCII_US);
188cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_ORPHANS] = String("PARATR_ORPHANS", RTL_TEXTENCODING_ASCII_US);
189cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_WIDOWS] = String("PARATR_WIDOWS", RTL_TEXTENCODING_ASCII_US);
190cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_TABSTOP] = String("PARATR_TABSTOP", RTL_TEXTENCODING_ASCII_US);
191cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_HYPHENZONE] = String("PARATR_HYPHENZONE", RTL_TEXTENCODING_ASCII_US);
192cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_DROP] = String("PARATR_DROP", RTL_TEXTENCODING_ASCII_US);
193cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_REGISTER] = String("PARATR_REGISTER", RTL_TEXTENCODING_ASCII_US);
194cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_NUMRULE] = String("PARATR_NUMRULE", RTL_TEXTENCODING_ASCII_US);
195cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_SCRIPTSPACE] = String("PARATR_SCRIPTSPACE", RTL_TEXTENCODING_ASCII_US);
196cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_HANGINGPUNCTUATION] = String("PARATR_HANGINGPUNCTUATION", RTL_TEXTENCODING_ASCII_US);
197cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_FORBIDDEN_RULES] = String("PARATR_FORBIDDEN_RULES", RTL_TEXTENCODING_ASCII_US);
198cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_VERTALIGN] = String("PARATR_VERTALIGN", RTL_TEXTENCODING_ASCII_US);
199cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_SNAPTOGRID] = String("PARATR_SNAPTOGRID", RTL_TEXTENCODING_ASCII_US);
200cdf0e10cSrcweir         aItemWhichMap[RES_PARATR_CONNECT_BORDER] = String("PARATR_CONNECT_BORDER", RTL_TEXTENCODING_ASCII_US);
201cdf0e10cSrcweir         aItemWhichMap[RES_FILL_ORDER] = String("FILL_ORDER", RTL_TEXTENCODING_ASCII_US);
202cdf0e10cSrcweir         aItemWhichMap[RES_FRM_SIZE] = String("FRM_SIZE", RTL_TEXTENCODING_ASCII_US);
203cdf0e10cSrcweir         aItemWhichMap[RES_PAPER_BIN] = String("PAPER_BIN", RTL_TEXTENCODING_ASCII_US);
204cdf0e10cSrcweir         aItemWhichMap[RES_LR_SPACE] = String("LR_SPACE", RTL_TEXTENCODING_ASCII_US);
205cdf0e10cSrcweir         aItemWhichMap[RES_UL_SPACE] = String("UL_SPACE", RTL_TEXTENCODING_ASCII_US);
206cdf0e10cSrcweir         aItemWhichMap[RES_PAGEDESC] = String("PAGEDESC", RTL_TEXTENCODING_ASCII_US);
207cdf0e10cSrcweir         aItemWhichMap[RES_BREAK] = String("BREAK", RTL_TEXTENCODING_ASCII_US);
208cdf0e10cSrcweir         aItemWhichMap[RES_CNTNT] = String("CNTNT", RTL_TEXTENCODING_ASCII_US);
209cdf0e10cSrcweir         aItemWhichMap[RES_HEADER] = String("HEADER", RTL_TEXTENCODING_ASCII_US);
210cdf0e10cSrcweir         aItemWhichMap[RES_FOOTER] = String("FOOTER", RTL_TEXTENCODING_ASCII_US);
211cdf0e10cSrcweir         aItemWhichMap[RES_PRINT] = String("PRINT", RTL_TEXTENCODING_ASCII_US);
212cdf0e10cSrcweir         aItemWhichMap[RES_OPAQUE] = String("OPAQUE", RTL_TEXTENCODING_ASCII_US);
213cdf0e10cSrcweir         aItemWhichMap[RES_PROTECT] = String("PROTECT", RTL_TEXTENCODING_ASCII_US);
214cdf0e10cSrcweir         aItemWhichMap[RES_SURROUND] = String("SURROUND", RTL_TEXTENCODING_ASCII_US);
215cdf0e10cSrcweir         aItemWhichMap[RES_VERT_ORIENT] = String("VERT_ORIENT", RTL_TEXTENCODING_ASCII_US);
216cdf0e10cSrcweir         aItemWhichMap[RES_HORI_ORIENT] = String("HORI_ORIENT", RTL_TEXTENCODING_ASCII_US);
217cdf0e10cSrcweir         aItemWhichMap[RES_ANCHOR] = String("ANCHOR", RTL_TEXTENCODING_ASCII_US);
218cdf0e10cSrcweir         aItemWhichMap[RES_BACKGROUND] = String("BACKGROUND", RTL_TEXTENCODING_ASCII_US);
219cdf0e10cSrcweir         aItemWhichMap[RES_BOX] = String("BOX", RTL_TEXTENCODING_ASCII_US);
220cdf0e10cSrcweir         aItemWhichMap[RES_SHADOW] = String("SHADOW", RTL_TEXTENCODING_ASCII_US);
221cdf0e10cSrcweir         aItemWhichMap[RES_FRMMACRO] = String("FRMMACRO", RTL_TEXTENCODING_ASCII_US);
222cdf0e10cSrcweir         aItemWhichMap[RES_COL] = String("COL", RTL_TEXTENCODING_ASCII_US);
223cdf0e10cSrcweir         aItemWhichMap[RES_KEEP] = String("KEEP", RTL_TEXTENCODING_ASCII_US);
224cdf0e10cSrcweir         aItemWhichMap[RES_URL] = String("URL", RTL_TEXTENCODING_ASCII_US);
225cdf0e10cSrcweir         aItemWhichMap[RES_EDIT_IN_READONLY] = String("EDIT_IN_READONLY", RTL_TEXTENCODING_ASCII_US);
226cdf0e10cSrcweir         aItemWhichMap[RES_LAYOUT_SPLIT] = String("LAYOUT_SPLIT", RTL_TEXTENCODING_ASCII_US);
227cdf0e10cSrcweir         aItemWhichMap[RES_CHAIN] = String("CHAIN", RTL_TEXTENCODING_ASCII_US);
228cdf0e10cSrcweir         aItemWhichMap[RES_TEXTGRID] = String("TEXTGRID", RTL_TEXTENCODING_ASCII_US);
229cdf0e10cSrcweir         aItemWhichMap[RES_LINENUMBER  ] = String("LINENUMBER  ", RTL_TEXTENCODING_ASCII_US);
230cdf0e10cSrcweir         aItemWhichMap[RES_FTN_AT_TXTEND] = String("FTN_AT_TXTEND", RTL_TEXTENCODING_ASCII_US);
231cdf0e10cSrcweir         aItemWhichMap[RES_END_AT_TXTEND] = String("END_AT_TXTEND", RTL_TEXTENCODING_ASCII_US);
232cdf0e10cSrcweir         aItemWhichMap[RES_COLUMNBALANCE] = String("COLUMNBALANCE", RTL_TEXTENCODING_ASCII_US);
233cdf0e10cSrcweir         aItemWhichMap[RES_FRAMEDIR] = String("FRAMEDIR", RTL_TEXTENCODING_ASCII_US);
234cdf0e10cSrcweir         aItemWhichMap[RES_HEADER_FOOTER_EAT_SPACING] = String("HEADER_FOOTER_EAT_SPACING", RTL_TEXTENCODING_ASCII_US);
235cdf0e10cSrcweir         aItemWhichMap[RES_ROW_SPLIT] = String("ROW_SPLIT", RTL_TEXTENCODING_ASCII_US);
236cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_MIRRORGRF] = String("GRFATR_MIRRORGRF", RTL_TEXTENCODING_ASCII_US);
237cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_CROPGRF] = String("GRFATR_CROPGRF", RTL_TEXTENCODING_ASCII_US);
238cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_ROTATION] = String("GRFATR_ROTATION", RTL_TEXTENCODING_ASCII_US);
239cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_LUMINANCE] = String("GRFATR_LUMINANCE", RTL_TEXTENCODING_ASCII_US);
240cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_CONTRAST] = String("GRFATR_CONTRAST", RTL_TEXTENCODING_ASCII_US);
241cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_CHANNELR] = String("GRFATR_CHANNELR", RTL_TEXTENCODING_ASCII_US);
242cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_CHANNELG] = String("GRFATR_CHANNELG", RTL_TEXTENCODING_ASCII_US);
243cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_CHANNELB] = String("GRFATR_CHANNELB", RTL_TEXTENCODING_ASCII_US);
244cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_GAMMA] = String("GRFATR_GAMMA", RTL_TEXTENCODING_ASCII_US);
245cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_INVERT] = String("GRFATR_INVERT", RTL_TEXTENCODING_ASCII_US);
246cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_TRANSPARENCY] = String("GRFATR_TRANSPARENCY", RTL_TEXTENCODING_ASCII_US);
247cdf0e10cSrcweir         aItemWhichMap[RES_GRFATR_DRAWMODE] = String("GRFATR_DRAWMODE", RTL_TEXTENCODING_ASCII_US);
248cdf0e10cSrcweir         aItemWhichMap[RES_BOXATR_FORMAT] = String("BOXATR_FORMAT", RTL_TEXTENCODING_ASCII_US);
249cdf0e10cSrcweir         aItemWhichMap[RES_BOXATR_FORMULA] = String("BOXATR_FORMULA", RTL_TEXTENCODING_ASCII_US);
250cdf0e10cSrcweir         aItemWhichMap[RES_BOXATR_VALUE] = String("BOXATR_VALUE", RTL_TEXTENCODING_ASCII_US);
251cdf0e10cSrcweir 
252cdf0e10cSrcweir         bInitialized = true;
253cdf0e10cSrcweir     }
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     return aItemWhichMap;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir 
lcl_dbg_out(const SfxPoolItem & rItem)258cdf0e10cSrcweir const String lcl_dbg_out(const SfxPoolItem & rItem)
259cdf0e10cSrcweir {
260cdf0e10cSrcweir     String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
261cdf0e10cSrcweir 
262cdf0e10cSrcweir     if (GetItemWhichMap().find(rItem.Which()) != GetItemWhichMap().end())
263cdf0e10cSrcweir         aStr += GetItemWhichMap()[rItem.Which()];
264cdf0e10cSrcweir     else
265cdf0e10cSrcweir         aStr += String::CreateFromInt32(rItem.Which());
266cdf0e10cSrcweir 
267cdf0e10cSrcweir     aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     return aStr;
270cdf0e10cSrcweir }
271cdf0e10cSrcweir 
dbg_out(const SfxPoolItem & rItem)272cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem & rItem)
273cdf0e10cSrcweir {
274cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rItem));
275cdf0e10cSrcweir }
276cdf0e10cSrcweir 
dbg_out(const SfxPoolItem * pItem)277cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem * pItem)
278cdf0e10cSrcweir {
279cdf0e10cSrcweir     return dbg_out(pItem ? lcl_dbg_out(*pItem) :
280cdf0e10cSrcweir                    String("(nil)", RTL_TEXTENCODING_ASCII_US));
281cdf0e10cSrcweir }
282cdf0e10cSrcweir 
lcl_dbg_out(const SfxItemSet & rSet)283cdf0e10cSrcweir SW_DLLPUBLIC const String lcl_dbg_out(const SfxItemSet & rSet)
284cdf0e10cSrcweir {
285cdf0e10cSrcweir     SfxItemIter aIter(rSet);
286cdf0e10cSrcweir     const SfxPoolItem * pItem;
287cdf0e10cSrcweir     bool bFirst = true;
288cdf0e10cSrcweir     String aStr = String("[ ", RTL_TEXTENCODING_ASCII_US);
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     pItem = aIter.FirstItem();
291cdf0e10cSrcweir 
292cdf0e10cSrcweir     while (pItem )
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir         if (!bFirst)
295cdf0e10cSrcweir             aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
296cdf0e10cSrcweir 
297cdf0e10cSrcweir         if ((sal_uIntPtr)pItem != SAL_MAX_SIZE)
298cdf0e10cSrcweir             aStr += lcl_dbg_out(*pItem);
299cdf0e10cSrcweir         else
300cdf0e10cSrcweir             aStr += String("invalid", RTL_TEXTENCODING_ASCII_US);
301cdf0e10cSrcweir 
302cdf0e10cSrcweir         bFirst = false;
303cdf0e10cSrcweir 
304cdf0e10cSrcweir         pItem = aIter.NextItem();
305cdf0e10cSrcweir     }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
308cdf0e10cSrcweir 
309cdf0e10cSrcweir     return aStr;
310cdf0e10cSrcweir }
311cdf0e10cSrcweir 
dbg_out(const SfxItemSet & rSet)312cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SfxItemSet & rSet)
313cdf0e10cSrcweir {
314cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rSet));
315cdf0e10cSrcweir }
316cdf0e10cSrcweir 
lcl_dbg_out(const SwTxtAttr & rAttr)317cdf0e10cSrcweir const String lcl_dbg_out(const SwTxtAttr & rAttr)
318cdf0e10cSrcweir {
319cdf0e10cSrcweir     String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     aStr += String::CreateFromInt32(*rAttr.GetStart());
322cdf0e10cSrcweir     aStr += String("->", RTL_TEXTENCODING_ASCII_US);
32369a74367SOliver-Rainer Wittmann     aStr += String::CreateFromInt32(*rAttr.End());
324cdf0e10cSrcweir     aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
325cdf0e10cSrcweir     aStr += lcl_dbg_out(rAttr.GetAttr());
326cdf0e10cSrcweir 
327cdf0e10cSrcweir     aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
328cdf0e10cSrcweir 
329cdf0e10cSrcweir     return aStr;
330cdf0e10cSrcweir }
331cdf0e10cSrcweir 
dbg_out(const SwTxtAttr & rAttr)332cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwTxtAttr & rAttr)
333cdf0e10cSrcweir {
334cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rAttr));
335cdf0e10cSrcweir }
336cdf0e10cSrcweir 
lcl_dbg_out(const SwpHints & rHints)337cdf0e10cSrcweir const String lcl_dbg_out(const SwpHints & rHints)
338cdf0e10cSrcweir {
339cdf0e10cSrcweir     String aStr("[ SwpHints\n", RTL_TEXTENCODING_ASCII_US);
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     for (sal_uInt16 i = 0; i < rHints.Count(); i++)
342cdf0e10cSrcweir     {
343cdf0e10cSrcweir         aStr += String("  ", RTL_TEXTENCODING_ASCII_US);
344cdf0e10cSrcweir         aStr += lcl_dbg_out(*rHints[i]);
345cdf0e10cSrcweir         aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
346cdf0e10cSrcweir     }
347cdf0e10cSrcweir 
348cdf0e10cSrcweir     aStr += String("]\n", RTL_TEXTENCODING_ASCII_US);
349cdf0e10cSrcweir 
350cdf0e10cSrcweir     return aStr;
351cdf0e10cSrcweir }
352cdf0e10cSrcweir 
dbg_out(const SwpHints & rHints)353cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwpHints &rHints)
354cdf0e10cSrcweir {
355cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rHints));
356cdf0e10cSrcweir }
357cdf0e10cSrcweir 
lcl_dbg_out(const SwPosition & rPos)358cdf0e10cSrcweir String lcl_dbg_out(const SwPosition & rPos)
359cdf0e10cSrcweir {
360cdf0e10cSrcweir     String aStr("( ", RTL_TEXTENCODING_ASCII_US);
361cdf0e10cSrcweir 
362cdf0e10cSrcweir     aStr += String::CreateFromInt32(rPos.nNode.GetIndex());
363cdf0e10cSrcweir     aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
364cdf0e10cSrcweir     aStr += String::CreateFromInt32(rPos.nContent.GetIndex());
365cdf0e10cSrcweir     aStr += String(": ", RTL_TEXTENCODING_ASCII_US);
366cdf0e10cSrcweir     aStr += String::CreateFromInt32
367cdf0e10cSrcweir         (reinterpret_cast<sal_IntPtr>(rPos.nContent.GetIdxReg()), 16);
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     aStr += String(" )", RTL_TEXTENCODING_ASCII_US);
370cdf0e10cSrcweir 
371cdf0e10cSrcweir     return aStr;
372cdf0e10cSrcweir }
373cdf0e10cSrcweir 
dbg_out(const SwPosition & rPos)374cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwPosition & rPos)
375cdf0e10cSrcweir {
376cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rPos));
377cdf0e10cSrcweir }
378cdf0e10cSrcweir 
lcl_dbg_out(const SwPaM & rPam)379cdf0e10cSrcweir String lcl_dbg_out(const SwPaM & rPam)
380cdf0e10cSrcweir {
381cdf0e10cSrcweir    String aStr("[ Pt: ", RTL_TEXTENCODING_ASCII_US);
382cdf0e10cSrcweir 
383cdf0e10cSrcweir    aStr += lcl_dbg_out(*rPam.GetPoint());
384cdf0e10cSrcweir 
385cdf0e10cSrcweir    if (rPam.HasMark())
386cdf0e10cSrcweir    {
387cdf0e10cSrcweir        aStr += String(", Mk: ", RTL_TEXTENCODING_ASCII_US);
388cdf0e10cSrcweir        aStr += lcl_dbg_out(*rPam.GetMark());
389cdf0e10cSrcweir    }
390cdf0e10cSrcweir 
391cdf0e10cSrcweir    aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
392cdf0e10cSrcweir 
393cdf0e10cSrcweir    return aStr;
394cdf0e10cSrcweir }
395cdf0e10cSrcweir 
dbg_out(const SwPaM & rPam)396cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwPaM & rPam)
397cdf0e10cSrcweir {
398cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rPam));
399cdf0e10cSrcweir }
400cdf0e10cSrcweir 
lcl_dbg_out(const SwNodeNum &)401cdf0e10cSrcweir String lcl_dbg_out(const SwNodeNum & )
402cdf0e10cSrcweir {
403cdf0e10cSrcweir     return String();/*rNum.ToString();*/
404cdf0e10cSrcweir }
405cdf0e10cSrcweir 
dbg_out(const SwNodeNum & rNum)406cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNodeNum & rNum)
407cdf0e10cSrcweir {
408cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rNum));
409cdf0e10cSrcweir }
410cdf0e10cSrcweir 
lcl_dbg_out(const SwRect & rRect)411cdf0e10cSrcweir String lcl_dbg_out(const SwRect & rRect)
412cdf0e10cSrcweir {
413cdf0e10cSrcweir     String aResult("[ [", RTL_TEXTENCODING_ASCII_US);
414cdf0e10cSrcweir 
415cdf0e10cSrcweir     aResult += String::CreateFromInt32(rRect.Left());
416cdf0e10cSrcweir     aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
417cdf0e10cSrcweir     aResult += String::CreateFromInt32(rRect.Top());
418cdf0e10cSrcweir     aResult += String("], [", RTL_TEXTENCODING_ASCII_US);
419cdf0e10cSrcweir     aResult += String::CreateFromInt32(rRect.Right());
420cdf0e10cSrcweir     aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
421cdf0e10cSrcweir     aResult += String::CreateFromInt32(rRect.Bottom());
422cdf0e10cSrcweir 
423cdf0e10cSrcweir     aResult += String("] ]", RTL_TEXTENCODING_ASCII_US);
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     return aResult;
426cdf0e10cSrcweir }
427cdf0e10cSrcweir 
dbg_out(const SwRect & rRect)428cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwRect & rRect)
429cdf0e10cSrcweir {
430cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rRect));
431cdf0e10cSrcweir }
432cdf0e10cSrcweir 
lcl_dbg_out(const SwFrmFmt & rFrmFmt)433cdf0e10cSrcweir String lcl_dbg_out(const SwFrmFmt & rFrmFmt)
434cdf0e10cSrcweir {
435cdf0e10cSrcweir     String aResult("[ ", RTL_TEXTENCODING_ASCII_US);
436cdf0e10cSrcweir 
437cdf0e10cSrcweir     char sBuffer[256];
438cdf0e10cSrcweir     sprintf(sBuffer, "%p", &rFrmFmt);
439cdf0e10cSrcweir 
440cdf0e10cSrcweir     aResult += String(sBuffer, RTL_TEXTENCODING_ASCII_US);
441cdf0e10cSrcweir     aResult += String("(", RTL_TEXTENCODING_ASCII_US);
442cdf0e10cSrcweir     aResult += rFrmFmt.GetName();
443cdf0e10cSrcweir     aResult += String(")", RTL_TEXTENCODING_ASCII_US);
444cdf0e10cSrcweir 
445cdf0e10cSrcweir     if (rFrmFmt.IsAuto())
446cdf0e10cSrcweir         aResult += String("*", RTL_TEXTENCODING_ASCII_US);
447cdf0e10cSrcweir 
448cdf0e10cSrcweir     aResult += String(" ,", RTL_TEXTENCODING_ASCII_US);
449cdf0e10cSrcweir     aResult += lcl_dbg_out(rFrmFmt.FindLayoutRect());
450cdf0e10cSrcweir     aResult += String(" ]", RTL_TEXTENCODING_ASCII_US);
451cdf0e10cSrcweir 
452cdf0e10cSrcweir     return aResult;
453cdf0e10cSrcweir }
454cdf0e10cSrcweir 
dbg_out(const SwFrmFmt & rFrmFmt)455cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwFrmFmt & rFrmFmt)
456cdf0e10cSrcweir {
457cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rFrmFmt));
458cdf0e10cSrcweir }
459cdf0e10cSrcweir 
lcl_AnchoredFrames(const SwNode & rNode)460cdf0e10cSrcweir const String lcl_AnchoredFrames(const SwNode & rNode)
461cdf0e10cSrcweir {
462cdf0e10cSrcweir     String aResult("[", RTL_TEXTENCODING_ASCII_US);
463cdf0e10cSrcweir 
464cdf0e10cSrcweir     const SwDoc * pDoc = rNode.GetDoc();
465cdf0e10cSrcweir     if (pDoc)
466cdf0e10cSrcweir     {
467cdf0e10cSrcweir         const SwSpzFrmFmts * pFrmFmts = pDoc->GetSpzFrmFmts();
468cdf0e10cSrcweir 
469cdf0e10cSrcweir         if (pFrmFmts)
470cdf0e10cSrcweir         {
471cdf0e10cSrcweir             bool bFirst = true;
472cdf0e10cSrcweir             for (sal_uInt16 nI = 0; nI < pFrmFmts->Count(); nI++)
473cdf0e10cSrcweir             {
474cdf0e10cSrcweir                 const SwFmtAnchor & rAnchor = (*pFrmFmts)[nI]->GetAnchor();
475cdf0e10cSrcweir                 const SwPosition * pPos = rAnchor.GetCntntAnchor();
476cdf0e10cSrcweir 
477cdf0e10cSrcweir                 if (pPos && &pPos->nNode.GetNode() == &rNode)
478cdf0e10cSrcweir                 {
479cdf0e10cSrcweir                     if (! bFirst)
480cdf0e10cSrcweir                         aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
481cdf0e10cSrcweir 
482cdf0e10cSrcweir                     if ((*pFrmFmts)[nI])
483cdf0e10cSrcweir                         aResult += lcl_dbg_out(*(*pFrmFmts)[nI]);
484cdf0e10cSrcweir                     bFirst = false;
485cdf0e10cSrcweir                 }
486cdf0e10cSrcweir             }
487cdf0e10cSrcweir         }
488cdf0e10cSrcweir     }
489cdf0e10cSrcweir 
490cdf0e10cSrcweir     aResult += String("]", RTL_TEXTENCODING_ASCII_US);
491cdf0e10cSrcweir 
492cdf0e10cSrcweir     return aResult;
493cdf0e10cSrcweir }
494cdf0e10cSrcweir 
lcl_dbg_out_NumType(sal_Int16 nType)495cdf0e10cSrcweir String lcl_dbg_out_NumType(sal_Int16 nType)
496cdf0e10cSrcweir {
497cdf0e10cSrcweir     String aTmpStr;
498cdf0e10cSrcweir 
499cdf0e10cSrcweir     switch (nType)
500cdf0e10cSrcweir     {
501cdf0e10cSrcweir     case SVX_NUM_NUMBER_NONE:
502cdf0e10cSrcweir         aTmpStr += String(" NONE", RTL_TEXTENCODING_ASCII_US);
503cdf0e10cSrcweir 
504cdf0e10cSrcweir         break;
505cdf0e10cSrcweir     case SVX_NUM_CHARS_UPPER_LETTER:
506cdf0e10cSrcweir         aTmpStr += String(" CHARS_UPPER_LETTER",
507cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
508cdf0e10cSrcweir 
509cdf0e10cSrcweir         break;
510cdf0e10cSrcweir     case SVX_NUM_CHARS_LOWER_LETTER:
511cdf0e10cSrcweir         aTmpStr += String(" CHARS_LOWER_LETTER",
512cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
513cdf0e10cSrcweir 
514cdf0e10cSrcweir         break;
515cdf0e10cSrcweir     case SVX_NUM_ROMAN_UPPER:
516cdf0e10cSrcweir         aTmpStr += String(" ROMAN_UPPER",
517cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
518cdf0e10cSrcweir 
519cdf0e10cSrcweir         break;
520cdf0e10cSrcweir     case SVX_NUM_ROMAN_LOWER:
521cdf0e10cSrcweir         aTmpStr += String(" ROMAN_LOWER",
522cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
523cdf0e10cSrcweir 
524cdf0e10cSrcweir         break;
525cdf0e10cSrcweir     case SVX_NUM_ARABIC:
526cdf0e10cSrcweir         aTmpStr += String(" ARABIC",
527cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
528cdf0e10cSrcweir 
529cdf0e10cSrcweir         break;
530cdf0e10cSrcweir     default:
531cdf0e10cSrcweir         aTmpStr += String(" ??",
532cdf0e10cSrcweir                           RTL_TEXTENCODING_ASCII_US);
533cdf0e10cSrcweir 
534cdf0e10cSrcweir         break;
535cdf0e10cSrcweir     }
536cdf0e10cSrcweir 
537cdf0e10cSrcweir     return aTmpStr;
538cdf0e10cSrcweir }
539cdf0e10cSrcweir 
lcl_dbg_out(const SwNode & rNode)540cdf0e10cSrcweir String lcl_dbg_out(const SwNode & rNode)
541cdf0e10cSrcweir {
542cdf0e10cSrcweir     String aTmpStr;
543cdf0e10cSrcweir 
544cdf0e10cSrcweir     aTmpStr += String("<node ", RTL_TEXTENCODING_ASCII_US);
545cdf0e10cSrcweir     aTmpStr += String("index=\"", RTL_TEXTENCODING_ASCII_US);
546cdf0e10cSrcweir     aTmpStr += String::CreateFromInt32(rNode.GetIndex());
547cdf0e10cSrcweir     aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
548cdf0e10cSrcweir 
549cdf0e10cSrcweir #ifdef DBG_UTIL
550cdf0e10cSrcweir     aTmpStr += String(" serial=\"", RTL_TEXTENCODING_ASCII_US);
551cdf0e10cSrcweir     aTmpStr += String::CreateFromInt32(rNode.GetSerial());
552cdf0e10cSrcweir     aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
553cdf0e10cSrcweir #endif
554cdf0e10cSrcweir 
555cdf0e10cSrcweir     aTmpStr += String(" type=\"", RTL_TEXTENCODING_ASCII_US);
556cdf0e10cSrcweir     aTmpStr += String::CreateFromInt32(sal_Int32( rNode.GetNodeType() ) );
557cdf0e10cSrcweir     aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
558cdf0e10cSrcweir 
559cdf0e10cSrcweir     aTmpStr += String(" pointer=\"", RTL_TEXTENCODING_ASCII_US);
560cdf0e10cSrcweir 
561cdf0e10cSrcweir     char aBuffer[128];
562cdf0e10cSrcweir     sprintf(aBuffer, "%p", &rNode);
563cdf0e10cSrcweir     aTmpStr += String(aBuffer, RTL_TEXTENCODING_ASCII_US);
564cdf0e10cSrcweir 
565cdf0e10cSrcweir     aTmpStr += String("\">", RTL_TEXTENCODING_ASCII_US);
566cdf0e10cSrcweir 
567cdf0e10cSrcweir     const SwTxtNode * pTxtNode = rNode.GetTxtNode();
568cdf0e10cSrcweir 
569cdf0e10cSrcweir     if (rNode.IsTxtNode())
570cdf0e10cSrcweir     {
571cdf0e10cSrcweir         const SfxItemSet * pAttrSet = pTxtNode->GetpSwAttrSet();
572cdf0e10cSrcweir 
573cdf0e10cSrcweir         aTmpStr += String("<txt>", RTL_TEXTENCODING_ASCII_US);
574cdf0e10cSrcweir         aTmpStr += pTxtNode->GetTxt().Copy(0, 10);
575cdf0e10cSrcweir         aTmpStr += String("</txt>", RTL_TEXTENCODING_ASCII_US);
576cdf0e10cSrcweir 
577cdf0e10cSrcweir         if (rNode.IsTableNode())
578cdf0e10cSrcweir             aTmpStr += String("<tbl/>", RTL_TEXTENCODING_ASCII_US);
579cdf0e10cSrcweir 
580cdf0e10cSrcweir         aTmpStr += String("<outlinelevel>", RTL_TEXTENCODING_ASCII_US);
581cdf0e10cSrcweir         aTmpStr += String::CreateFromInt32(pTxtNode->GetAttrOutlineLevel()-1);
582cdf0e10cSrcweir         aTmpStr += String("</outlinelevel>", RTL_TEXTENCODING_ASCII_US);
583cdf0e10cSrcweir 
584cdf0e10cSrcweir 		const SwNumRule * pNumRule = pTxtNode->GetNumRule();
585cdf0e10cSrcweir 
586cdf0e10cSrcweir 		if (pNumRule != NULL)
587cdf0e10cSrcweir 		{
588cdf0e10cSrcweir 			aTmpStr += String("<number>", RTL_TEXTENCODING_ASCII_US);
589cdf0e10cSrcweir             if ( pTxtNode->GetNum() )
590cdf0e10cSrcweir             {
591cdf0e10cSrcweir                 aTmpStr += lcl_dbg_out(*(pTxtNode->GetNum()));
592cdf0e10cSrcweir             }
593cdf0e10cSrcweir 			aTmpStr += String("</number>", RTL_TEXTENCODING_ASCII_US);
594cdf0e10cSrcweir 
595cdf0e10cSrcweir             aTmpStr += String("<rule>", RTL_TEXTENCODING_ASCII_US);
596cdf0e10cSrcweir             aTmpStr += pNumRule->GetName();
597cdf0e10cSrcweir 
598cdf0e10cSrcweir             const SfxPoolItem * pItem = NULL;
599cdf0e10cSrcweir 
600cdf0e10cSrcweir             if (pAttrSet && SFX_ITEM_SET ==
601cdf0e10cSrcweir                 pAttrSet->GetItemState(RES_PARATR_NUMRULE, sal_False, &pItem))
602cdf0e10cSrcweir             {
603cdf0e10cSrcweir                 aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
604cdf0e10cSrcweir                 aTmpStr +=
605cdf0e10cSrcweir                     static_cast<const SwNumRuleItem *>(pItem)->GetValue();
606cdf0e10cSrcweir                 aTmpStr += String(")", RTL_TEXTENCODING_ASCII_US);
607cdf0e10cSrcweir                 aTmpStr += String("*", RTL_TEXTENCODING_ASCII_US);
608cdf0e10cSrcweir             }
609cdf0e10cSrcweir 
610cdf0e10cSrcweir             const SwNumFmt * pNumFmt = NULL;
611cdf0e10cSrcweir             aTmpStr += String("</rule>", RTL_TEXTENCODING_ASCII_US);
612cdf0e10cSrcweir 
613cdf0e10cSrcweir             if (pTxtNode->GetActualListLevel() > 0)
614cdf0e10cSrcweir                 pNumFmt = pNumRule->GetNumFmt( static_cast< sal_uInt16 >(pTxtNode->GetActualListLevel()) );
615cdf0e10cSrcweir 
616cdf0e10cSrcweir             if (pNumFmt)
617cdf0e10cSrcweir             {
618cdf0e10cSrcweir                 aTmpStr += String("<numformat>", RTL_TEXTENCODING_ASCII_US);
619cdf0e10cSrcweir                 aTmpStr +=
620cdf0e10cSrcweir                     lcl_dbg_out_NumType(pNumFmt->GetNumberingType());
621cdf0e10cSrcweir                 aTmpStr += String("</numformat>", RTL_TEXTENCODING_ASCII_US);
622cdf0e10cSrcweir             }
623cdf0e10cSrcweir 		}
624cdf0e10cSrcweir 
625cdf0e10cSrcweir         if (pTxtNode->IsCountedInList())
626cdf0e10cSrcweir             aTmpStr += String("<counted/>", RTL_TEXTENCODING_ASCII_US);
627cdf0e10cSrcweir 
628cdf0e10cSrcweir         SwFmtColl * pColl = pTxtNode->GetFmtColl();
629cdf0e10cSrcweir 
630cdf0e10cSrcweir         if (pColl)
631cdf0e10cSrcweir         {
632cdf0e10cSrcweir             aTmpStr += String("<coll>", RTL_TEXTENCODING_ASCII_US);
633cdf0e10cSrcweir             aTmpStr += pColl->GetName();
634cdf0e10cSrcweir 
635cdf0e10cSrcweir             aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
636cdf0e10cSrcweir             aTmpStr += String::CreateFromInt32
637cdf0e10cSrcweir                 //(static_cast<SwTxtFmtColl *>(pColl)->GetOutlineLevel());//#outline level,zhaojianwei
638*721ad428SOliver-Rainer Wittmann 				(static_cast<SwTxtFmtColl *>(pColl)->IsAssignedToListLevelOfOutlineStyle()
639*721ad428SOliver-Rainer Wittmann 				 ? static_cast<SwTxtFmtColl *>(pColl)->GetAssignedOutlineStyleLevel()
640*721ad428SOliver-Rainer Wittmann 				 : 0);//<-end,zhaojianwei
641cdf0e10cSrcweir 
642cdf0e10cSrcweir             const SwNumRuleItem & rItem =
643cdf0e10cSrcweir                 static_cast<const SwNumRuleItem &>
644cdf0e10cSrcweir                 (pColl->GetFmtAttr(RES_PARATR_NUMRULE));
645cdf0e10cSrcweir             const String sNumruleName = rItem.GetValue();
646cdf0e10cSrcweir 
647cdf0e10cSrcweir             if (sNumruleName.Len() > 0)
648cdf0e10cSrcweir             {
649cdf0e10cSrcweir                 aTmpStr += String(", ", RTL_TEXTENCODING_ASCII_US);
650cdf0e10cSrcweir                 aTmpStr += sNumruleName;
651cdf0e10cSrcweir             }
652cdf0e10cSrcweir             aTmpStr += String(")", RTL_TEXTENCODING_ASCII_US);
653cdf0e10cSrcweir             aTmpStr += String("</coll>", RTL_TEXTENCODING_ASCII_US);
654cdf0e10cSrcweir         }
655cdf0e10cSrcweir 
656cdf0e10cSrcweir         SwFmtColl * pCColl = pTxtNode->GetCondFmtColl();
657cdf0e10cSrcweir 
658cdf0e10cSrcweir         if (pCColl)
659cdf0e10cSrcweir         {
660cdf0e10cSrcweir             aTmpStr += String("<ccoll>", RTL_TEXTENCODING_ASCII_US);
661cdf0e10cSrcweir             aTmpStr += pCColl->GetName();
662cdf0e10cSrcweir             aTmpStr += String("</ccoll>", RTL_TEXTENCODING_ASCII_US);
663cdf0e10cSrcweir         }
664cdf0e10cSrcweir 
665cdf0e10cSrcweir         aTmpStr += String("<frms>", RTL_TEXTENCODING_ASCII_US);
666cdf0e10cSrcweir         aTmpStr += lcl_AnchoredFrames(rNode);
667cdf0e10cSrcweir         aTmpStr += String("</frms>", RTL_TEXTENCODING_ASCII_US);
668cdf0e10cSrcweir 
669cdf0e10cSrcweir         if (bDbgOutPrintAttrSet)
670cdf0e10cSrcweir         {
671cdf0e10cSrcweir             aTmpStr += String("<attrs>", RTL_TEXTENCODING_ASCII_US);
672cdf0e10cSrcweir             aTmpStr += lcl_dbg_out(pTxtNode->GetSwAttrSet());
673cdf0e10cSrcweir             aTmpStr += String("</attrs>", RTL_TEXTENCODING_ASCII_US);
674cdf0e10cSrcweir         }
675cdf0e10cSrcweir     }
676cdf0e10cSrcweir     else if (rNode.IsStartNode())
677cdf0e10cSrcweir     {
678cdf0e10cSrcweir         aTmpStr += String("<start end=\"", RTL_TEXTENCODING_ASCII_US);
679cdf0e10cSrcweir 
680cdf0e10cSrcweir         const SwStartNode * pStartNode = dynamic_cast<const SwStartNode *> (&rNode);
681cdf0e10cSrcweir         if (pStartNode != NULL)
682cdf0e10cSrcweir             aTmpStr += String::CreateFromInt32(pStartNode->EndOfSectionNode()->GetIndex());
683cdf0e10cSrcweir 
684cdf0e10cSrcweir         aTmpStr += String("\"/>", RTL_TEXTENCODING_ASCII_US);
685cdf0e10cSrcweir     }
686cdf0e10cSrcweir     else if (rNode.IsEndNode())
687cdf0e10cSrcweir         aTmpStr += String("<end/>", RTL_TEXTENCODING_ASCII_US);
688cdf0e10cSrcweir 
689cdf0e10cSrcweir     aTmpStr += String("</node>", RTL_TEXTENCODING_ASCII_US);
690cdf0e10cSrcweir 
691cdf0e10cSrcweir     return aTmpStr;
692cdf0e10cSrcweir }
693cdf0e10cSrcweir 
dbg_out(const SwNode & rNode)694cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNode & rNode)
695cdf0e10cSrcweir {
696cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rNode));
697cdf0e10cSrcweir }
698cdf0e10cSrcweir 
dbg_out(const SwNode * pNode)699cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNode * pNode)
700cdf0e10cSrcweir {
701cdf0e10cSrcweir     if (NULL != pNode)
702cdf0e10cSrcweir         return dbg_out(*pNode);
703cdf0e10cSrcweir     else
704cdf0e10cSrcweir         return NULL;
705cdf0e10cSrcweir }
706cdf0e10cSrcweir 
dbg_out(const SwCntntNode * pNode)707cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwCntntNode * pNode)
708cdf0e10cSrcweir {
709cdf0e10cSrcweir     if (NULL != pNode)
710cdf0e10cSrcweir         return dbg_out(*pNode);
711cdf0e10cSrcweir     else
712cdf0e10cSrcweir         return NULL;
713cdf0e10cSrcweir }
714cdf0e10cSrcweir 
dbg_out(const SwTxtNode * pNode)715cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwTxtNode * pNode)
716cdf0e10cSrcweir {
717cdf0e10cSrcweir     if (NULL != pNode)
718cdf0e10cSrcweir         return dbg_out(*pNode);
719cdf0e10cSrcweir     else
720cdf0e10cSrcweir         return NULL;
721cdf0e10cSrcweir }
722cdf0e10cSrcweir 
lcl_dbg_add_node(const SwNodePtr & pNode,void * pArgs)723cdf0e10cSrcweir sal_Bool lcl_dbg_add_node(const SwNodePtr & pNode, void * pArgs)
724cdf0e10cSrcweir {
725cdf0e10cSrcweir     if (pNode)
726cdf0e10cSrcweir     {
727cdf0e10cSrcweir         (*((String *) pArgs)) += lcl_dbg_out(*pNode);
728cdf0e10cSrcweir         (*((String *) pArgs)) += String("\n", RTL_TEXTENCODING_ASCII_US);
729cdf0e10cSrcweir     }
730cdf0e10cSrcweir 
731cdf0e10cSrcweir     //MBA: this code didn't compile, needed to add a return value
732cdf0e10cSrcweir     return sal_True;
733cdf0e10cSrcweir }
734cdf0e10cSrcweir 
lcl_dbg_nodes_inner(String & aStr,SwNodes & rNodes,sal_uLong & nIndex)735cdf0e10cSrcweir void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIndex)
736cdf0e10cSrcweir {
737cdf0e10cSrcweir     SwNode * pNode = rNodes[nIndex];
738cdf0e10cSrcweir     SwStartNode * pStartNode = dynamic_cast<SwStartNode *> (pNode);
739cdf0e10cSrcweir 
740cdf0e10cSrcweir     SwNode * pEndNode = NULL;
741cdf0e10cSrcweir     if (pStartNode != NULL)
742cdf0e10cSrcweir         pEndNode = pStartNode->EndOfSectionNode();
743cdf0e10cSrcweir 
744cdf0e10cSrcweir     sal_uLong nCount = rNodes.Count();
745cdf0e10cSrcweir     sal_uLong nStartIndex = nIndex;
746cdf0e10cSrcweir 
747cdf0e10cSrcweir     bool bDone = false;
748cdf0e10cSrcweir 
749cdf0e10cSrcweir     String aTag;
750cdf0e10cSrcweir     if (pNode->IsTableNode())
751cdf0e10cSrcweir         aTag += String("table", RTL_TEXTENCODING_ASCII_US);
752cdf0e10cSrcweir     else if (pNode->IsSectionNode())
753cdf0e10cSrcweir         aTag += String("section", RTL_TEXTENCODING_ASCII_US);
754cdf0e10cSrcweir     else
755cdf0e10cSrcweir         aTag += String("nodes", RTL_TEXTENCODING_ASCII_US);
756cdf0e10cSrcweir 
757cdf0e10cSrcweir     aStr += String("<", RTL_TEXTENCODING_ASCII_US);
758cdf0e10cSrcweir     aStr += aTag;
759cdf0e10cSrcweir     aStr += String(">", RTL_TEXTENCODING_ASCII_US);
760cdf0e10cSrcweir 
761cdf0e10cSrcweir     while (! bDone)
762cdf0e10cSrcweir     {
763cdf0e10cSrcweir         if (pNode->IsStartNode() && nIndex != nStartIndex)
764cdf0e10cSrcweir             lcl_dbg_nodes_inner(aStr, rNodes, nIndex);
765cdf0e10cSrcweir         else
766cdf0e10cSrcweir         {
767cdf0e10cSrcweir             aStr += lcl_dbg_out(*pNode);
768cdf0e10cSrcweir             aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
769cdf0e10cSrcweir 
770cdf0e10cSrcweir             nIndex++;
771cdf0e10cSrcweir         }
772cdf0e10cSrcweir 
773cdf0e10cSrcweir         if (pNode == pEndNode || nIndex >= nCount)
774cdf0e10cSrcweir             bDone = true;
775cdf0e10cSrcweir         else
776cdf0e10cSrcweir             pNode = rNodes[nIndex];
777cdf0e10cSrcweir     }
778cdf0e10cSrcweir 
779cdf0e10cSrcweir     aStr += String("</", RTL_TEXTENCODING_ASCII_US);
780cdf0e10cSrcweir     aStr += aTag;
781cdf0e10cSrcweir     aStr += String(">\n", RTL_TEXTENCODING_ASCII_US);
782cdf0e10cSrcweir }
783cdf0e10cSrcweir 
lcl_dbg_out(SwNodes & rNodes)784cdf0e10cSrcweir String lcl_dbg_out(SwNodes & rNodes)
785cdf0e10cSrcweir {
786cdf0e10cSrcweir     String aStr("<nodes-array>", RTL_TEXTENCODING_ASCII_US);
787cdf0e10cSrcweir 
788cdf0e10cSrcweir     sal_uLong nIndex = 0;
789cdf0e10cSrcweir     sal_uLong nCount = rNodes.Count();
790cdf0e10cSrcweir 
791cdf0e10cSrcweir     while (nIndex < nCount)
792cdf0e10cSrcweir     {
793cdf0e10cSrcweir         lcl_dbg_nodes_inner(aStr, rNodes, nIndex);
794cdf0e10cSrcweir     }
795cdf0e10cSrcweir 
796cdf0e10cSrcweir     aStr += String("</nodes-array>\n", RTL_TEXTENCODING_ASCII_US);
797cdf0e10cSrcweir 
798cdf0e10cSrcweir     return aStr;
799cdf0e10cSrcweir }
800cdf0e10cSrcweir 
dbg_out(SwNodes & rNodes)801cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(SwNodes & rNodes)
802cdf0e10cSrcweir {
803cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rNodes));
804cdf0e10cSrcweir }
805cdf0e10cSrcweir 
lcl_dbg_out(const SwUndo & rUndo)806cdf0e10cSrcweir String lcl_dbg_out(const SwUndo & rUndo)
807cdf0e10cSrcweir {
808cdf0e10cSrcweir     String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
809cdf0e10cSrcweir 
810cdf0e10cSrcweir     aStr += String::CreateFromInt32(
811cdf0e10cSrcweir                 static_cast<SfxUndoAction const&>(rUndo).GetId());
812cdf0e10cSrcweir     aStr += String(": ", RTL_TEXTENCODING_ASCII_US);
813cdf0e10cSrcweir 
814cdf0e10cSrcweir     aStr += rUndo.GetComment();
815cdf0e10cSrcweir     aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
816cdf0e10cSrcweir 
817cdf0e10cSrcweir     return aStr;
818cdf0e10cSrcweir }
819cdf0e10cSrcweir 
dbg_out(const SwUndo & rUndo)820cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwUndo & rUndo)
821cdf0e10cSrcweir {
822cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rUndo));
823cdf0e10cSrcweir }
824cdf0e10cSrcweir 
lcl_dbg_out(SwOutlineNodes & rNodes)825cdf0e10cSrcweir String lcl_dbg_out(SwOutlineNodes & rNodes)
826cdf0e10cSrcweir {
827cdf0e10cSrcweir     String aStr("[\n", RTL_TEXTENCODING_ASCII_US);
828cdf0e10cSrcweir 
829cdf0e10cSrcweir     for (sal_uInt16 i = 0; i < rNodes.Count(); i++)
830cdf0e10cSrcweir     {
831cdf0e10cSrcweir         aStr += lcl_dbg_out(*rNodes[i]);
832cdf0e10cSrcweir         aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
833cdf0e10cSrcweir     }
834cdf0e10cSrcweir 
835cdf0e10cSrcweir     aStr += String("]\n", RTL_TEXTENCODING_ASCII_US);
836cdf0e10cSrcweir 
837cdf0e10cSrcweir     return aStr;
838cdf0e10cSrcweir }
839cdf0e10cSrcweir 
dbg_out(SwOutlineNodes & rNodes)840cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(SwOutlineNodes & rNodes)
841cdf0e10cSrcweir {
842cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rNodes));
843cdf0e10cSrcweir }
844cdf0e10cSrcweir 
lcl_dbg_out(const SwRewriter & rRewriter)845cdf0e10cSrcweir String lcl_dbg_out(const SwRewriter & rRewriter)
846cdf0e10cSrcweir {
847cdf0e10cSrcweir 	(void) rRewriter;
848cdf0e10cSrcweir     String aResult;
849cdf0e10cSrcweir 
850cdf0e10cSrcweir     //aResult = rRewriter.ToString();
851cdf0e10cSrcweir 
852cdf0e10cSrcweir     return aResult;
853cdf0e10cSrcweir }
854cdf0e10cSrcweir 
dbg_out(const SwRewriter & rRewriter)855cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwRewriter & rRewriter)
856cdf0e10cSrcweir {
857cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rRewriter));
858cdf0e10cSrcweir }
859cdf0e10cSrcweir 
lcl_dbg_out(const SvxNumberFormat & rFmt)860cdf0e10cSrcweir String lcl_dbg_out(const SvxNumberFormat & rFmt)
861cdf0e10cSrcweir {
862cdf0e10cSrcweir     String aResult;
863cdf0e10cSrcweir 
864cdf0e10cSrcweir     aResult = lcl_dbg_out_NumType(rFmt.GetNumberingType());
865cdf0e10cSrcweir 
866cdf0e10cSrcweir     return aResult;
867cdf0e10cSrcweir }
868cdf0e10cSrcweir 
lcl_dbg_out(const SwNumRule & rRule)869cdf0e10cSrcweir String lcl_dbg_out(const SwNumRule & rRule)
870cdf0e10cSrcweir {
871cdf0e10cSrcweir     String aResult("[ ", RTL_TEXTENCODING_ASCII_US);
872cdf0e10cSrcweir 
873cdf0e10cSrcweir     aResult += rRule.GetName();
874cdf0e10cSrcweir     aResult += String(" [", RTL_TEXTENCODING_ASCII_US);
875cdf0e10cSrcweir 
876cdf0e10cSrcweir     for (sal_uInt8 n = 0; n < MAXLEVEL; n++)
877cdf0e10cSrcweir     {
878cdf0e10cSrcweir         if (n > 0)
879cdf0e10cSrcweir             aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
880cdf0e10cSrcweir 
881cdf0e10cSrcweir         aResult += lcl_dbg_out(rRule.Get(n));
882cdf0e10cSrcweir     }
883cdf0e10cSrcweir 
884cdf0e10cSrcweir     aResult += String("]", RTL_TEXTENCODING_ASCII_US);
885cdf0e10cSrcweir 
886cdf0e10cSrcweir     aResult += String("]", RTL_TEXTENCODING_ASCII_US);
887cdf0e10cSrcweir 
888cdf0e10cSrcweir     return aResult;
889cdf0e10cSrcweir }
890cdf0e10cSrcweir 
dbg_out(const SwNumRule & rRule)891cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNumRule & rRule)
892cdf0e10cSrcweir {
893cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rRule));
894cdf0e10cSrcweir }
895cdf0e10cSrcweir 
lcl_dbg_out(const SwTxtFmtColl & rFmt)896cdf0e10cSrcweir String lcl_dbg_out(const SwTxtFmtColl & rFmt)
897cdf0e10cSrcweir {
898cdf0e10cSrcweir     String aResult(rFmt.GetName());
899cdf0e10cSrcweir 
900cdf0e10cSrcweir     aResult += String("(", RTL_TEXTENCODING_ASCII_US);
901cdf0e10cSrcweir     aResult += String::CreateFromInt32(rFmt.GetAttrOutlineLevel());
902cdf0e10cSrcweir     aResult += String(")", RTL_TEXTENCODING_ASCII_US);
903cdf0e10cSrcweir 
904cdf0e10cSrcweir     return aResult;
905cdf0e10cSrcweir }
906cdf0e10cSrcweir 
dbg_out(const SwTxtFmtColl & rFmt)907cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwTxtFmtColl & rFmt)
908cdf0e10cSrcweir {
909cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rFmt));
910cdf0e10cSrcweir }
911cdf0e10cSrcweir 
lcl_dbg_out(const SwFrmFmts & rFrmFmts)912cdf0e10cSrcweir String lcl_dbg_out(const SwFrmFmts & rFrmFmts)
913cdf0e10cSrcweir {
914cdf0e10cSrcweir     return lcl_dbg_out_SvPtrArr<SwFrmFmts>(rFrmFmts);
915cdf0e10cSrcweir }
916cdf0e10cSrcweir 
dbg_out(const SwFrmFmts & rFrmFmts)917cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwFrmFmts & rFrmFmts)
918cdf0e10cSrcweir {
919cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rFrmFmts));
920cdf0e10cSrcweir }
921cdf0e10cSrcweir 
lcl_dbg_out(const SwNumRuleTbl & rTbl)922cdf0e10cSrcweir String lcl_dbg_out(const SwNumRuleTbl & rTbl)
923cdf0e10cSrcweir {
924cdf0e10cSrcweir     String aResult("[", RTL_TEXTENCODING_ASCII_US);
925cdf0e10cSrcweir 
926cdf0e10cSrcweir     for (sal_uInt16 n = 0; n < rTbl.Count(); n++)
927cdf0e10cSrcweir     {
928cdf0e10cSrcweir         if (n > 0)
929cdf0e10cSrcweir             aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
930cdf0e10cSrcweir 
931cdf0e10cSrcweir         aResult += rTbl[n]->GetName();
932cdf0e10cSrcweir 
933cdf0e10cSrcweir         char sBuffer[256];
934cdf0e10cSrcweir         sprintf(sBuffer, "(%p)", rTbl[n]);
935cdf0e10cSrcweir         aResult += String(sBuffer, RTL_TEXTENCODING_ASCII_US);
936cdf0e10cSrcweir     }
937cdf0e10cSrcweir 
938cdf0e10cSrcweir     aResult += String("]", RTL_TEXTENCODING_ASCII_US);
939cdf0e10cSrcweir 
940cdf0e10cSrcweir     return aResult;
941cdf0e10cSrcweir }
942cdf0e10cSrcweir 
dbg_out(const SwNumRuleTbl & rTbl)943cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNumRuleTbl & rTbl)
944cdf0e10cSrcweir {
945cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rTbl));
946cdf0e10cSrcweir }
947cdf0e10cSrcweir 
lcl_TokenType2Str(FormTokenType nType)948cdf0e10cSrcweir String lcl_TokenType2Str(FormTokenType nType)
949cdf0e10cSrcweir {
950cdf0e10cSrcweir     switch(nType)
951cdf0e10cSrcweir     {
952cdf0e10cSrcweir     case TOKEN_ENTRY_NO:
953cdf0e10cSrcweir         return String("NO", RTL_TEXTENCODING_ASCII_US);
954cdf0e10cSrcweir 	case TOKEN_ENTRY_TEXT:
955cdf0e10cSrcweir         return String("ENTRY_TEXT", RTL_TEXTENCODING_ASCII_US);
956cdf0e10cSrcweir 	case TOKEN_ENTRY:
957cdf0e10cSrcweir         return String("ENTRY", RTL_TEXTENCODING_ASCII_US);
958cdf0e10cSrcweir 	case TOKEN_TAB_STOP:
959cdf0e10cSrcweir         return String("TAB_STOP", RTL_TEXTENCODING_ASCII_US);
960cdf0e10cSrcweir 	case TOKEN_TEXT:
961cdf0e10cSrcweir         return String("TOKEN_TEXT", RTL_TEXTENCODING_ASCII_US);
962cdf0e10cSrcweir 	case TOKEN_PAGE_NUMS:
963cdf0e10cSrcweir         return String("NUMS", RTL_TEXTENCODING_ASCII_US);
964cdf0e10cSrcweir 	case TOKEN_CHAPTER_INFO:
965cdf0e10cSrcweir         return String("CHAPTER_INFO", RTL_TEXTENCODING_ASCII_US);
966cdf0e10cSrcweir 	case TOKEN_LINK_START:
967cdf0e10cSrcweir         return String("LINK_START", RTL_TEXTENCODING_ASCII_US);
968cdf0e10cSrcweir 	case TOKEN_LINK_END:
969cdf0e10cSrcweir         return String("LINK_END", RTL_TEXTENCODING_ASCII_US);
970cdf0e10cSrcweir 	case TOKEN_AUTHORITY:
971cdf0e10cSrcweir         return String("AUTHORITY", RTL_TEXTENCODING_ASCII_US);
972cdf0e10cSrcweir     case TOKEN_END:
973cdf0e10cSrcweir         return String("END", RTL_TEXTENCODING_ASCII_US);
974cdf0e10cSrcweir     default:
975cdf0e10cSrcweir         return String("??", RTL_TEXTENCODING_ASCII_US);
976cdf0e10cSrcweir     }
977cdf0e10cSrcweir 
978cdf0e10cSrcweir     ASSERT(false, "should not be reached");
979cdf0e10cSrcweir 
980cdf0e10cSrcweir     return  String("??", RTL_TEXTENCODING_ASCII_US);
981cdf0e10cSrcweir }
982cdf0e10cSrcweir 
lcl_dbg_out(const SwFormToken & rToken)983cdf0e10cSrcweir String lcl_dbg_out(const SwFormToken & rToken)
984cdf0e10cSrcweir {
985cdf0e10cSrcweir     return rToken.GetString();
986cdf0e10cSrcweir }
987cdf0e10cSrcweir 
dbg_out(const SwFormToken & rToken)988cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwFormToken & rToken)
989cdf0e10cSrcweir {
990cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rToken));
991cdf0e10cSrcweir }
992cdf0e10cSrcweir 
lcl_dbg_out(const SwFormTokens & rTokens)993cdf0e10cSrcweir String lcl_dbg_out(const SwFormTokens & rTokens)
994cdf0e10cSrcweir {
995cdf0e10cSrcweir     String aStr("[", RTL_TEXTENCODING_ASCII_US);
996cdf0e10cSrcweir 
997cdf0e10cSrcweir     SwFormTokens::const_iterator aIt;
998cdf0e10cSrcweir 
999cdf0e10cSrcweir     for (aIt = rTokens.begin(); aIt != rTokens.end(); aIt++)
1000cdf0e10cSrcweir     {
1001cdf0e10cSrcweir         if (aIt != rTokens.begin())
1002cdf0e10cSrcweir             aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
1003cdf0e10cSrcweir 
1004cdf0e10cSrcweir         aStr += lcl_TokenType2Str(aIt->eTokenType);
1005cdf0e10cSrcweir         aStr += String(": ", RTL_TEXTENCODING_ASCII_US);
1006cdf0e10cSrcweir         aStr += lcl_dbg_out(*aIt);
1007cdf0e10cSrcweir     }
1008cdf0e10cSrcweir 
1009cdf0e10cSrcweir     aStr += String("]" , RTL_TEXTENCODING_ASCII_US);
1010cdf0e10cSrcweir 
1011cdf0e10cSrcweir     return aStr;
1012cdf0e10cSrcweir }
1013cdf0e10cSrcweir 
dbg_out(const SwFormTokens & rTokens)1014cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwFormTokens & rTokens)
1015cdf0e10cSrcweir {
1016cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rTokens));
1017cdf0e10cSrcweir }
1018cdf0e10cSrcweir 
lcl_dbg_out(const SwNodeRange & rRange)1019cdf0e10cSrcweir String lcl_dbg_out(const SwNodeRange & rRange)
1020cdf0e10cSrcweir {
1021cdf0e10cSrcweir     String aStr("[", RTL_TEXTENCODING_ASCII_US);
1022cdf0e10cSrcweir 
1023cdf0e10cSrcweir     aStr += lcl_dbg_out(SwPosition(rRange.aStart));
1024cdf0e10cSrcweir     aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
1025cdf0e10cSrcweir     aStr += lcl_dbg_out(SwPosition(rRange.aEnd));
1026cdf0e10cSrcweir 
1027cdf0e10cSrcweir     aStr += String("]" , RTL_TEXTENCODING_ASCII_US);
1028cdf0e10cSrcweir 
1029cdf0e10cSrcweir     return aStr;
1030cdf0e10cSrcweir }
1031cdf0e10cSrcweir 
dbg_out(const SwNodeRange & rRange)1032cdf0e10cSrcweir SW_DLLPUBLIC const char * dbg_out(const SwNodeRange & rRange)
1033cdf0e10cSrcweir {
1034cdf0e10cSrcweir     return dbg_out(lcl_dbg_out(rRange));
1035cdf0e10cSrcweir }
1036cdf0e10cSrcweir 
1037cdf0e10cSrcweir #endif // DEBUG
1038cdf0e10cSrcweir 
1039