Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svl/style.hxx>
30 : : #include <wrtsh.hxx>
31 : : #include <view.hxx>
32 : : #include <docsh.hxx>
33 : : #include <docfnote.hxx>
34 : : #include <impfnote.hxx>
35 : : #include <ftninfo.hxx>
36 : : #include <fmtcol.hxx>
37 : : #include <pagedesc.hxx>
38 : : #include <charfmt.hxx>
39 : : #include <docstyle.hxx>
40 : : #include <wdocsh.hxx>
41 : : #include <uitool.hxx>
42 : : #include <poolfmt.hxx>
43 : : #include <swstyle.h>
44 : : #include <helpid.h>
45 : : #include <misc.hrc>
46 : : #include <docfnote.hrc>
47 : : #include <frmui.hrc>
48 : : #include <SwStyleNameMapper.hxx>
49 : :
50 : 0 : SwFootNoteOptionDlg::SwFootNoteOptionDlg( Window *pParent, SwWrtShell &rS ) :
51 : : SfxTabDialog( pParent, SW_RES(DLG_DOC_FOOTNOTE) ),
52 : 0 : rSh( rS )
53 : : {
54 : 0 : FreeResource();
55 : 0 : RemoveResetButton();
56 : :
57 : 0 : aOldOkHdl = GetOKButton().GetClickHdl();
58 : 0 : GetOKButton().SetClickHdl( LINK( this, SwFootNoteOptionDlg, OkHdl ) );
59 : :
60 : 0 : AddTabPage( TP_FOOTNOTEOPTION, SwFootNoteOptionPage::Create, 0 );
61 : 0 : AddTabPage( TP_ENDNOTEOPTION, SwEndNoteOptionPage::Create, 0 );
62 : 0 : }
63 : :
64 : 0 : void SwFootNoteOptionDlg::PageCreated( sal_uInt16 /*nId*/, SfxTabPage &rPage )
65 : : {
66 : 0 : ((SwEndNoteOptionPage&)rPage).SetShell( rSh );
67 : 0 : }
68 : :
69 : 0 : SwFootNoteOptionDlg::~SwFootNoteOptionDlg()
70 : : {
71 : 0 : }
72 : :
73 : 0 : IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn )
74 : : {
75 : 0 : SfxItemSet aDummySet(rSh.GetAttrPool(), 1, 1 );
76 : 0 : SfxTabPage *pPage = GetTabPage( TP_FOOTNOTEOPTION );
77 : 0 : if ( pPage )
78 : 0 : pPage->FillItemSet( aDummySet );
79 : 0 : pPage = GetTabPage( TP_ENDNOTEOPTION );
80 : 0 : if ( pPage )
81 : 0 : pPage->FillItemSet( aDummySet );
82 : 0 : aOldOkHdl.Call( pBtn );
83 : 0 : return 0;
84 : : }
85 : :
86 : :
87 : : //----------------------------------------------------------------------
88 : :
89 : :
90 : 0 : SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
91 : : const SfxItemSet &rSet ) :
92 : : SfxTabPage( pParent, SW_RES(bEN ? TP_ENDNOTEOPTION : TP_FOOTNOTEOPTION), rSet ),
93 : : aNumFL (this, SW_RES( FL_NUM )),
94 : :
95 : : aNumTypeFT (this, SW_RES( FT_NUMTYPE )),
96 : : aNumViewBox (this, SW_RES( LB_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES),
97 : : aOffsetLbl (this, SW_RES( FT_OFFSET )),
98 : : aOffsetFld (this, SW_RES( FLD_OFFSET )),
99 : : aNumCountFT (this, SW_RES( FT_NUMCOUNT )),
100 : : aNumCountBox (this, SW_RES( LB_NUMCOUNT )),
101 : : aPrefixFT (this, SW_RES( FT_PREFIX )),
102 : : aPrefixED (this, SW_RES( ED_PREFIX )),
103 : : aSuffixFT (this, SW_RES( FT_SUFFIX )),
104 : : aSuffixED (this, SW_RES( ED_SUFFIX )),
105 : : aPosFT (this, SW_RES( FT_POS )),
106 : : aPosPageBox (this, SW_RES( RB_POS_PAGE )),
107 : : aPosChapterBox (this, SW_RES( RB_POS_CHAPTER)),
108 : :
109 : : aTemplFL (this, SW_RES( FL_TEMPL )),
110 : : aParaTemplLbl (this, SW_RES( FT_PARA_TEMPL)),
111 : : aParaTemplBox (this, SW_RES( LB_PARA_TEMPL)),
112 : : aPageTemplLbl (this, SW_RES( FT_PAGE_TEMPL)),
113 : : aPageTemplBox (this, SW_RES( LB_PAGE_TEMPL)),
114 : :
115 : : aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)),
116 : : aFtnCharAnchorTemplLbl( this, SW_RES( FT_ANCHR_CHARFMT)),
117 : : aFtnCharAnchorTemplBox( this, SW_RES( LB_ANCHR_CHARFMT)),
118 : : aFtnCharTextTemplLbl( this, SW_RES( FT_TEXT_CHARFMT)),
119 : : aFtnCharTextTemplBox( this, SW_RES( LB_TEXT_CHARFMT)),
120 : :
121 : : aContFL (this, SW_RES( FL_CONT )),
122 : : aContLbl (this, SW_RES( FT_CONT )),
123 : : aContEdit (this, SW_RES( ED_CONT )),
124 : : aContFromLbl (this, SW_RES( FT_CONT_FROM )),
125 : : aContFromEdit (this, SW_RES( ED_CONT_FROM )),
126 : :
127 : : aNumDoc(aNumCountBox.GetEntry(FTNNUM_DOC)),
128 : : aNumPage(aNumCountBox.GetEntry(FTNNUM_PAGE)),
129 : : aNumChapter(aNumCountBox.GetEntry(FTNNUM_CHAPTER)),
130 : : pSh( 0 ),
131 : : bPosDoc(sal_False),
132 : 0 : bEndNote( bEN )
133 : : {
134 : 0 : FreeResource();
135 : :
136 : 0 : aPosPageBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosPageHdl));
137 : 0 : aPosChapterBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl));
138 : 0 : aNumCountBox.SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl));
139 : :
140 : 0 : aPosPageBox.SetAccessibleRelationMemberOf(&aPosFT);
141 : 0 : aPosChapterBox.SetAccessibleRelationMemberOf(&aPosFT);
142 : 0 : }
143 : :
144 : 0 : void SwEndNoteOptionPage::Reset( const SfxItemSet& )
145 : : {
146 : 0 : SwEndNoteInfo *pInf = bEndNote ? new SwEndNoteInfo( pSh->GetEndNoteInfo() )
147 : 0 : : new SwFtnInfo( pSh->GetFtnInfo() );
148 : 0 : SfxObjectShell * pDocSh = SfxObjectShell::Current();
149 : : sal_uInt16 i;
150 : :
151 : 0 : if(PTR_CAST(SwWebDocShell, pDocSh))
152 : : {
153 : 0 : aParaTemplLbl .Hide();
154 : 0 : aParaTemplBox .Hide();
155 : 0 : aPageTemplLbl .Hide();
156 : 0 : aPageTemplBox .Hide();
157 : 0 : aFtnCharTextTemplLbl.Hide();
158 : 0 : aFtnCharTextTemplBox.Hide();
159 : 0 : aFtnCharAnchorTemplLbl.Hide();
160 : 0 : aFtnCharAnchorTemplBox.Hide();
161 : 0 : aCharTemplFL .Hide();
162 : 0 : aTemplFL .Hide();
163 : : }
164 : 0 : if ( bEndNote )
165 : : {
166 : 0 : aPosPageBox.Hide();
167 : 0 : aPosChapterBox.Hide();
168 : 0 : aNumCountBox.Hide();
169 : 0 : aContLbl.Hide();
170 : 0 : aContEdit.Hide();
171 : 0 : aContFromLbl.Hide();
172 : 0 : aContFromEdit.Hide();
173 : 0 : aContFL.Hide();
174 : 0 : bPosDoc = sal_True;
175 : : }
176 : : else
177 : : {
178 : 0 : const SwFtnInfo &rInf = pSh->GetFtnInfo();
179 : : // set position (page, chapter)
180 : 0 : if ( rInf.ePos == FTNPOS_PAGE )
181 : : {
182 : 0 : aPosPageBox.Check();
183 : 0 : aPageTemplLbl.Enable(sal_False);
184 : 0 : aPageTemplBox.Enable(sal_False);
185 : : }
186 : : else
187 : : {
188 : 0 : aPosChapterBox.Check();
189 : 0 : aNumCountBox.RemoveEntry(aNumPage);
190 : 0 : aNumCountBox.RemoveEntry(aNumChapter);
191 : 0 : bPosDoc = sal_True;
192 : : }
193 : : // reference tests
194 : 0 : aContEdit.SetText(rInf.aQuoVadis);
195 : 0 : aContFromEdit.SetText(rInf.aErgoSum);
196 : :
197 : : // collected
198 : 0 : SelectNumbering(rInf.eNum);
199 : : }
200 : :
201 : : // numbering
202 : : // art
203 : 0 : aNumViewBox.SelectNumberingType( pInf->aFmt.GetNumberingType());
204 : 0 : aOffsetFld.SetValue(pInf->nFtnOffset + 1);
205 : 0 : aPrefixED.SetText(pInf->GetPrefix());
206 : 0 : aSuffixED.SetText(pInf->GetSuffix());
207 : :
208 : : const SwCharFmt* pCharFmt = pInf->GetCharFmt(
209 : 0 : *pSh->GetView().GetDocShell()->GetDoc());
210 : 0 : aFtnCharTextTemplBox.SelectEntry(pCharFmt->GetName());
211 : 0 : aFtnCharTextTemplBox.SaveValue();
212 : :
213 : 0 : pCharFmt = pInf->GetAnchorCharFmt( *pSh->GetDoc() );
214 : 0 : aFtnCharAnchorTemplBox.SelectEntry( pCharFmt->GetName() );
215 : 0 : aFtnCharAnchorTemplBox.SaveValue();
216 : :
217 : : // styles special regions
218 : : // paragraph
219 : 0 : SfxStyleSheetBasePool* pStyleSheetPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
220 : 0 : pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, SWSTYLEBIT_EXTRA);
221 : 0 : SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
222 : 0 : while(pStyle)
223 : : {
224 : 0 : aParaTemplBox.InsertEntry(pStyle->GetName());
225 : 0 : pStyle = pStyleSheetPool->Next();
226 : : }
227 : :
228 : 0 : String sStr;
229 : : SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(bEndNote ? RES_POOLCOLL_ENDNOTE
230 : 0 : : RES_POOLCOLL_FOOTNOTE), sStr );
231 : 0 : if(LISTBOX_ENTRY_NOTFOUND == aParaTemplBox.GetEntryPos( sStr ) )
232 : 0 : aParaTemplBox.InsertEntry( sStr );
233 : :
234 : 0 : SwTxtFmtColl* pColl = pInf->GetFtnTxtColl();
235 : 0 : if( !pColl )
236 : 0 : aParaTemplBox.SelectEntry( sStr ); // Default
237 : : else
238 : : {
239 : : OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong");
240 : 0 : const sal_uInt16 nPos = aParaTemplBox.GetEntryPos(pColl->GetName());
241 : 0 : if( LISTBOX_ENTRY_NOTFOUND != nPos )
242 : 0 : aParaTemplBox.SelectEntryPos( nPos );
243 : : else
244 : : {
245 : 0 : aParaTemplBox.InsertEntry(pColl->GetName());
246 : 0 : aParaTemplBox.SelectEntry(pColl->GetName());
247 : : }
248 : : }
249 : :
250 : : // page
251 : 0 : for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i )
252 : 0 : aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr ));
253 : :
254 : 0 : sal_uInt16 nCount = pSh->GetPageDescCnt();
255 : 0 : for(i = 0; i < nCount; ++i)
256 : : {
257 : 0 : const SwPageDesc &rPageDesc = pSh->GetPageDesc(i);
258 : 0 : if(LISTBOX_ENTRY_NOTFOUND == aPageTemplBox.GetEntryPos(rPageDesc.GetName()))
259 : 0 : aPageTemplBox.InsertEntry(rPageDesc.GetName());
260 : : }
261 : :
262 : 0 : aPageTemplBox.SelectEntry( pInf->GetPageDesc( *pSh->GetDoc() )->GetName());
263 : 0 : delete pInf;
264 : 0 : }
265 : :
266 : 0 : SwEndNoteOptionPage::~SwEndNoteOptionPage()
267 : : {
268 : 0 : }
269 : :
270 : 0 : SfxTabPage *SwEndNoteOptionPage::Create( Window *pParent, const SfxItemSet &rSet )
271 : : {
272 : 0 : return new SwEndNoteOptionPage( pParent, sal_True, rSet );
273 : : }
274 : :
275 : : /*------------------------------------------------------------------------
276 : : Description: Different kinds of numbering; because the Listbox has
277 : : varying numbers of entries, here are functions to
278 : : set and query the intended kind of numbering.
279 : : ------------------------------------------------------------------------*/
280 : 0 : void SwEndNoteOptionPage::SelectNumbering(int eNum)
281 : : {
282 : 0 : String sSelect;
283 : 0 : switch(eNum)
284 : : {
285 : : case FTNNUM_DOC:
286 : 0 : sSelect = aNumDoc;
287 : 0 : break;
288 : : case FTNNUM_PAGE:
289 : 0 : sSelect = aNumPage;
290 : 0 : break;
291 : : case FTNNUM_CHAPTER:
292 : 0 : sSelect = aNumChapter;
293 : 0 : break;
294 : : #if OSL_DEBUG_LEVEL > 0
295 : : default:
296 : : OSL_FAIL("Which numbering type?");
297 : : #endif
298 : : }
299 : 0 : aNumCountBox.SelectEntry(sSelect);
300 : 0 : NumCountHdl( &aNumCountBox );
301 : 0 : }
302 : :
303 : :
304 : :
305 : 0 : int SwEndNoteOptionPage::GetNumbering() const
306 : : {
307 : 0 : const sal_uInt16 nPos = aNumCountBox.GetSelectEntryPos();
308 : 0 : return (int) bPosDoc? nPos + 1: nPos;
309 : : }
310 : :
311 : 0 : void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
312 : : {
313 : 0 : pSh = &rShell;
314 : : // collect character templates
315 : 0 : aFtnCharTextTemplBox.Clear();
316 : 0 : aFtnCharAnchorTemplBox.Clear();
317 : : ::FillCharStyleListBox(aFtnCharTextTemplBox,
318 : 0 : pSh->GetView().GetDocShell());
319 : :
320 : : ::FillCharStyleListBox(aFtnCharAnchorTemplBox,
321 : 0 : pSh->GetView().GetDocShell());
322 : 0 : }
323 : :
324 : : /*------------------------------------------------------------------------
325 : : Description: Handler behind the button to collect the footnote at the
326 : : page. In this case all kinds of numbering can be used.
327 : : ------------------------------------------------------------------------*/
328 : :
329 : :
330 : 0 : IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl)
331 : : {
332 : 0 : const SwFtnNum eNum = (const SwFtnNum)GetNumbering();
333 : 0 : bPosDoc = sal_False;
334 : 0 : if(LISTBOX_ENTRY_NOTFOUND == aNumCountBox.GetEntryPos(aNumPage))
335 : : {
336 : 0 : aNumCountBox.InsertEntry(aNumPage, FTNNUM_PAGE);
337 : 0 : aNumCountBox.InsertEntry(aNumChapter, FTNNUM_CHAPTER);
338 : 0 : SelectNumbering(eNum);
339 : : }
340 : 0 : aPageTemplLbl.Enable(sal_False);
341 : 0 : aPageTemplBox.Enable(sal_False);
342 : :
343 : 0 : return 0;
344 : : }
345 : :
346 : 0 : IMPL_LINK_NOARG(SwEndNoteOptionPage, NumCountHdl)
347 : : {
348 : 0 : sal_Bool bEnable = sal_True;
349 : 0 : if( aNumCountBox.GetEntryCount() - 1 != aNumCountBox.GetSelectEntryPos() )
350 : : {
351 : 0 : bEnable = sal_False;
352 : 0 : aOffsetFld.SetValue(1);
353 : : }
354 : 0 : aOffsetLbl.Enable(bEnable);
355 : 0 : aOffsetFld.Enable(bEnable);
356 : 0 : return 0;
357 : : }
358 : :
359 : : /*------------------------------------------------------------------------
360 : : Description: Handler behind the button to collect the footnote at the
361 : : chapter or end of the document. In this case no pagewise
362 : : numbering can be used.
363 : : ------------------------------------------------------------------------*/
364 : :
365 : :
366 : 0 : IMPL_LINK_NOARG_INLINE_START(SwEndNoteOptionPage, PosChapterHdl)
367 : : {
368 : 0 : if ( !bPosDoc )
369 : 0 : SelectNumbering(FTNNUM_DOC);
370 : :
371 : 0 : bPosDoc = sal_True;
372 : 0 : aNumCountBox.RemoveEntry(aNumPage);
373 : 0 : aNumCountBox.RemoveEntry(aNumChapter);
374 : 0 : aPageTemplLbl.Enable();
375 : 0 : aPageTemplBox.Enable();
376 : 0 : return 0;
377 : : }
378 : 0 : IMPL_LINK_NOARG_INLINE_END(SwEndNoteOptionPage, PosChapterHdl)
379 : :
380 : 0 : SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const String& rCharFmtName )
381 : : {
382 : 0 : SwCharFmt* pFmt = 0;
383 : 0 : sal_uInt16 nChCount = pSh->GetCharFmtCount();
384 : 0 : for(sal_uInt16 i = 0; i< nChCount; i++)
385 : : {
386 : 0 : SwCharFmt& rChFmt = pSh->GetCharFmt(i);
387 : 0 : if(rChFmt.GetName() == rCharFmtName )
388 : : {
389 : 0 : pFmt = &rChFmt;
390 : 0 : break;
391 : : }
392 : : }
393 : 0 : if(!pFmt)
394 : : {
395 : 0 : SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
396 : : SfxStyleSheetBase* pBase;
397 : 0 : pBase = pPool->Find(rCharFmtName, SFX_STYLE_FAMILY_CHAR);
398 : 0 : if(!pBase)
399 : 0 : pBase = &pPool->Make(rCharFmtName, SFX_STYLE_FAMILY_CHAR);
400 : 0 : pFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt();
401 : : }
402 : 0 : return pFmt;
403 : : }
404 : :
405 : 0 : sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
406 : : {
407 : 0 : SwEndNoteInfo *pInf = bEndNote ? new SwEndNoteInfo() : new SwFtnInfo();
408 : :
409 : 0 : pInf->nFtnOffset = static_cast< sal_uInt16 >(aOffsetFld.GetValue() -1);
410 : 0 : pInf->aFmt.SetNumberingType(aNumViewBox.GetSelectedNumberingType() );
411 : 0 : pInf->SetPrefix(aPrefixED.GetText());
412 : 0 : pInf->SetSuffix(aSuffixED.GetText());
413 : :
414 : : pInf->SetCharFmt( lcl_GetCharFormat( pSh,
415 : 0 : aFtnCharTextTemplBox.GetSelectEntry() ) );
416 : : pInf->SetAnchorCharFmt( lcl_GetCharFormat( pSh,
417 : 0 : aFtnCharAnchorTemplBox.GetSelectEntry() ) );
418 : :
419 : : // paragraph template
420 : 0 : sal_uInt16 nPos = aParaTemplBox.GetSelectEntryPos();
421 : 0 : if(LISTBOX_ENTRY_NOTFOUND != nPos)
422 : : {
423 : 0 : const String aFmtName( aParaTemplBox.GetSelectEntry() );
424 : 0 : SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY);
425 : : OSL_ENSURE(pColl, "paragraph style not found");
426 : 0 : pInf->SetFtnTxtColl(*pColl);
427 : : }
428 : :
429 : : // page template
430 : : pInf->ChgPageDesc( pSh->FindPageDescByName(
431 : 0 : aPageTemplBox.GetSelectEntry(), sal_True ) );
432 : :
433 : 0 : if ( bEndNote )
434 : : {
435 : 0 : if ( !(*pInf == pSh->GetEndNoteInfo()) )
436 : 0 : pSh->SetEndNoteInfo( *pInf );
437 : : }
438 : : else
439 : : {
440 : 0 : SwFtnInfo *pI = (SwFtnInfo*)pInf;
441 : 0 : pI->ePos = aPosPageBox.IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER;
442 : 0 : pI->eNum = (SwFtnNum)GetNumbering();
443 : 0 : pI->aQuoVadis = aContEdit.GetText();
444 : 0 : pI->aErgoSum = aContFromEdit.GetText();
445 : 0 : if ( !(*pI == pSh->GetFtnInfo()) )
446 : 0 : pSh->SetFtnInfo( *pI );
447 : : }
448 : 0 : delete pInf;
449 : 0 : return sal_True;
450 : : }
451 : :
452 : 0 : SwFootNoteOptionPage::SwFootNoteOptionPage( Window *pParent, const SfxItemSet &rSet ) :
453 : 0 : SwEndNoteOptionPage( pParent, sal_False, rSet )
454 : : {
455 : 0 : }
456 : :
457 : 0 : SwFootNoteOptionPage::~SwFootNoteOptionPage()
458 : : {
459 : 0 : }
460 : :
461 : 0 : SfxTabPage *SwFootNoteOptionPage::Create(Window *pParent, const SfxItemSet &rSet )
462 : : {
463 : 0 : return new SwFootNoteOptionPage( pParent, rSet );
464 : : }
465 : :
466 : :
467 : :
468 : :
469 : :
470 : :
471 : :
472 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|