Files
libreoffice/sw/source/core/doc/poolfmt.cxx

337 lines
10 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <memory>
2000-09-18 23:08:29 +00:00
#include <hintids.hxx>
#include <i18nlangtag/mslangid.hxx>
2000-11-20 08:16:31 +00:00
#include <unotools/localedatawrapper.hxx>
#include <editeng/paperinf.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lspcitem.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/opaqitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/cmapitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/escapementitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/charrotateitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/scriptspaceitem.hxx>
#include <viewopt.hxx>
2000-09-18 23:08:29 +00:00
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <DocumentSettingManager.hxx>
#include <IDocumentState.hxx>
#include <IDocumentStylePoolAccess.hxx>
2000-09-18 23:08:29 +00:00
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <fmtfsize.hxx>
#include <poolfmt.hxx>
#include <paratr.hxx>
#include <pagedesc.hxx>
#include <frmtool.hxx>
#include <charfmt.hxx>
#include <docary.hxx>
#include <fmtcol.hxx>
#include <ndtxt.hxx>
#include <fmtline.hxx>
migrate to boost::gettext * all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-06-11 20:56:30 +01:00
#include <strings.hrc>
#include <GetMetricVal.hxx>
#include <numrule.hxx>
#include <swtable.hxx>
#include <tblafmt.hxx>
Merge back branch alg_writerframes to trunk (cherry picked from commit b635b4fa4e42053d30ab639643d2236a20243f62) Conflicts: comphelper/inc/comphelper/TypeGeneration.hxx comphelper/source/property/TypeGeneration.cxx cui/source/factory/dlgfact.hxx cui/source/inc/cuitabarea.hxx cui/source/tabpages/tabarea.cxx cui/source/tabpages/tabarea.hrc cui/source/tabpages/tabarea.src cui/source/tabpages/tparea.cxx drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx drawinglayer/source/texture/texture.cxx editeng/inc/editeng/unotext.hxx editeng/source/items/frmitems.cxx include/drawinglayer/texture/texture.hxx include/editeng/brushitem.hxx include/svx/sdr/primitive2d/sdrdecompositiontools.hxx include/svx/svxids.hrc include/xmloff/xmltypes.hxx reportdesign/source/ui/misc/UITools.cxx sc/source/ui/drawfunc/drawsh.cxx sfx2/source/dialog/tabdlg.cxx svl/source/undo/undo.cxx svx/inc/svx/unoshprp.hxx sw/Library_sw.mk sw/inc/doc.hxx sw/inc/format.hxx sw/inc/frmfmt.hxx sw/inc/swatrset.hxx sw/inc/unomap.hxx sw/inc/unoprnms.hxx sw/source/core/access/accpara.cxx sw/source/core/attr/format.cxx sw/source/core/attr/swatrset.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/notxtfrm.cxx sw/source/core/inc/frame.hxx sw/source/core/inc/frmtool.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/txtfly.cxx sw/source/core/txtnode/fntcache.cxx sw/source/core/uibase/app/docst.cxx sw/source/core/uibase/app/docstyle.cxx sw/source/core/uibase/shells/drawdlg.cxx sw/source/core/uibase/shells/frmsh.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unostyle.cxx sw/source/ui/fmtui/tmpdlg.cxx sw/source/ui/fmtui/tmpdlg.src sw/source/ui/frmdlg/frmdlg.cxx sw/source/ui/frmdlg/frmpage.src sw/source/ui/inc/frmsh.hxx xmloff/source/text/txtprhdl.cxx xmloff/source/text/txtprmap.cxx Change-Id: Id3ffaa83bb5594d287f1ac8f2c1c9cf55c70946d
2014-03-19 16:17:02 +00:00
#include <svx/xdef.hxx>
Related: #i124638# Second step of DrawingLayer FillAttributes... for Writer objects, now added support for Paragraph and PageStyle (including Header and Footer) for direct attributes and style attributes (cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b) Conflicts: cui/source/factory/dlgfact.cxx cui/source/factory/dlgfact.hxx cui/source/inc/bbdlg.hxx cui/source/inc/cuires.hrc cui/source/tabpages/bbdlg.cxx cui/source/tabpages/bbdlg.src cui/source/tabpages/page.cxx cui/source/tabpages/tparea.cxx include/svx/pagectrl.hxx include/svx/svxdlg.hxx include/svx/svxids.hrc include/xmloff/PageMasterStyleMap.hxx include/xmloff/prstylei.hxx include/xmloff/txtprmap.hxx svx/Package_inc.mk svx/inc/svx/hdft.hxx svx/source/dialog/hdft.cxx svx/source/dialog/pagectrl.cxx svx/source/tbxctrls/tbxcolorupdate.cxx svx/source/unodraw/unobrushitemhelper.cxx sw/Library_sw.mk sw/inc/fillattributes.hxx sw/inc/format.hxx sw/inc/frmatr.hxx sw/inc/frmfmt.hxx sw/inc/hintids.hxx sw/inc/hints.hxx sw/inc/ndtxt.hxx sw/inc/node.hxx sw/inc/swunohelper.hxx sw/inc/unobrushitemhelper.hxx sw/inc/unoprnms.hxx sw/source/core/attr/format.cxx sw/source/core/attr/hints.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/poolfmt.cxx sw/source/core/doc/visiturl.cxx sw/source/core/docnode/node.cxx sw/source/core/inc/frame.hxx sw/source/core/inc/frmtool.hxx sw/source/core/inc/rolbck.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/fillattributes.cxx sw/source/core/layout/findfrm.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/rolbck.cxx sw/source/core/unocore/swunohelper.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unoparagraph.cxx sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unostyle.cxx sw/source/ui/chrdlg/paradlg.src sw/source/ui/chrdlg/pardlg.cxx sw/source/ui/fmtui/tmpdlg.cxx sw/source/ui/fmtui/tmpdlg.src sw/source/uibase/app/docst.cxx sw/source/uibase/app/docstyle.cxx sw/source/uibase/frmdlg/colex.cxx sw/source/uibase/shells/basesh.cxx sw/source/uibase/shells/textsh1.cxx sw/source/uibase/uiview/viewstat.cxx sw/source/uibase/utlui/uitool.cxx xmloff/inc/PageMasterImportContext.hxx xmloff/inc/xmloff/XMLShapeStyleContext.hxx xmloff/source/draw/XMLShapeStyleContext.cxx xmloff/source/draw/sdpropls.hxx xmloff/source/style/PageMasterExportPropMapper.cxx xmloff/source/style/PageMasterImportContext.cxx xmloff/source/style/PageMasterPropHdlFactory.cxx xmloff/source/style/PageMasterStyleMap.cxx xmloff/source/style/prstylei.cxx xmloff/source/text/txtexppr.cxx xmloff/source/text/txtprhdl.cxx xmloff/source/text/txtprmap.cxx xmloff/source/text/txtstyli.cxx Conflicts: svx/source/dialog/hdft.cxx sw/source/core/doc/visiturl.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtatr2.cxx sw/source/core/unocore/unostyle.cxx Change-Id: I7e8779db6c0cbd1e242b63eab888f468f2de509a
2014-06-02 15:00:50 +00:00
#include <svx/xfillit0.hxx>
using namespace ::editeng;
using namespace ::com::sun::star;
void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
{
rSet.Put( rItem );
sal_uInt16 nWhCJK = 0, nWhCTL = 0;
switch( rItem.Which() )
{
case RES_CHRATR_FONTSIZE:
nWhCJK = RES_CHRATR_CJK_FONTSIZE;
nWhCTL = RES_CHRATR_CTL_FONTSIZE;
break;
case RES_CHRATR_FONT:
nWhCJK = RES_CHRATR_CJK_FONT;
nWhCTL = RES_CHRATR_CTL_FONT;
break;
case RES_CHRATR_LANGUAGE:
nWhCJK = RES_CHRATR_CJK_LANGUAGE;
nWhCTL = RES_CHRATR_CTL_LANGUAGE;
break;
case RES_CHRATR_POSTURE:
nWhCJK = RES_CHRATR_CJK_POSTURE;
nWhCTL = RES_CHRATR_CTL_POSTURE;
break;
case RES_CHRATR_WEIGHT:
nWhCJK = RES_CHRATR_CJK_WEIGHT;
nWhCTL = RES_CHRATR_CTL_WEIGHT;
break;
}
if( nWhCJK )
{
std::unique_ptr<SfxPoolItem> pNewItem(rItem.CloneSetWhich(nWhCJK));
rSet.Put( *pNewItem );
}
if( nWhCTL )
{
std::unique_ptr<SfxPoolItem> pNewItem(rItem.CloneSetWhich(nWhCTL));
rSet.Put( *pNewItem );
}
}
/// Return the AutoCollection by its Id. If it doesn't
/// exist yet, create it.
/// If the String pointer is defined, then only query for
/// the Attribute descriptions. It doesn't create a style!
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
{
return MsLangId::isRightToLeft(nLanguage) ?
SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
}
// See if the Paragraph/Character/Frame/Page style is in use
bool SwDoc::IsUsed( const SwModify& rModify ) const
2000-09-18 23:08:29 +00:00
{
2012-01-11 16:07:29 +01:00
// Check if we have dependent ContentNodes in the Nodes array
// (also indirect ones for derived Formats)
SwAutoFormatGetDocNode aGetHt( &GetNodes() );
2000-09-18 23:08:29 +00:00
return !rModify.GetInfo( aGetHt );
}
// See if Table style is in use
bool SwDoc::IsUsed( const SwTableAutoFormat& rTableAutoFormat) const
{
size_t nTableCount = GetTableFrameFormatCount(true);
for (size_t i=0; i < nTableCount; ++i)
{
SwFrameFormat* pFrameFormat = &GetTableFrameFormat(i, true);
SwTable* pTable = SwTable::FindTable(pFrameFormat);
if (pTable->GetTableStyleName() == rTableAutoFormat.GetName())
return true;
}
return false;
}
2012-01-11 16:07:29 +01:00
// See if the NumRule is used
bool SwDoc::IsUsed( const SwNumRule& rRule )
2000-09-18 23:08:29 +00:00
{
bool bUsed = rRule.GetTextNodeListSize() > 0 ||
rRule.GetParagraphStyleListSize() > 0;
2000-09-18 23:08:29 +00:00
return bUsed;
}
const OUString* SwDoc::GetDocPattern(size_t const nPos) const
{
if (nPos >= m_PatternNames.size())
return nullptr;
return &m_PatternNames[nPos];
}
// Look for the style name's position. If it doesn't exist,
2012-01-11 16:07:29 +01:00
// insert a anew
size_t SwDoc::SetDocPattern(const OUString& rPatternName)
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( !rPatternName.isEmpty(), "no Document style name" );
2000-09-18 23:08:29 +00:00
auto const iter(
std::find(m_PatternNames.begin(), m_PatternNames.end(), rPatternName));
if (iter != m_PatternNames.end())
{
return std::distance(m_PatternNames.begin(), iter);
}
else
{
m_PatternNames.push_back(rPatternName);
getIDocumentState().SetModified();
return m_PatternNames.size() - 1;
}
2000-09-18 23:08:29 +00:00
}
sal_uInt16 GetPoolParent( sal_uInt16 nId )
2000-09-18 23:08:29 +00:00
{
sal_uInt16 nRet = USHRT_MAX;
2012-01-11 16:07:29 +01:00
if( POOLGRP_NOCOLLID & nId ) // 1 == Formats / 0 == Collections
2000-09-18 23:08:29 +00:00
{
switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId )
{
case POOLGRP_CHARFMT:
case POOLGRP_FRAMEFMT:
2012-01-11 16:07:29 +01:00
nRet = 0; // derived from the default
2000-09-18 23:08:29 +00:00
break;
case POOLGRP_PAGEDESC:
case POOLGRP_NUMRULE:
2012-01-11 16:07:29 +01:00
break; // there are no derivations
2000-09-18 23:08:29 +00:00
}
}
else
{
switch( COLL_GET_RANGE_BITS & nId )
{
case COLL_TEXT_BITS:
switch( nId )
{
case RES_POOLCOLL_STANDARD:
nRet = 0; break;
case RES_POOLCOLL_TEXT_IDENT:
case RES_POOLCOLL_TEXT_NEGIDENT:
case RES_POOLCOLL_TEXT_MOVE:
case RES_POOLCOLL_CONFRONTATION:
case RES_POOLCOLL_MARGINAL:
nRet = RES_POOLCOLL_TEXT; break;
case RES_POOLCOLL_TEXT:
case RES_POOLCOLL_GREETING:
case RES_POOLCOLL_SIGNATURE:
case RES_POOLCOLL_HEADLINE_BASE:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_HEADLINE1:
case RES_POOLCOLL_HEADLINE2:
case RES_POOLCOLL_HEADLINE3:
case RES_POOLCOLL_HEADLINE4:
case RES_POOLCOLL_HEADLINE5:
case RES_POOLCOLL_HEADLINE6:
case RES_POOLCOLL_HEADLINE7:
case RES_POOLCOLL_HEADLINE8:
case RES_POOLCOLL_HEADLINE9:
case RES_POOLCOLL_HEADLINE10:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
}
break;
case COLL_LISTS_BITS:
switch( nId )
{
case RES_POOLCOLL_NUMBUL_BASE:
nRet = RES_POOLCOLL_TEXT; break;
default:
nRet = RES_POOLCOLL_NUMBUL_BASE; break;
}
break;
case COLL_EXTRA_BITS:
switch( nId )
{
case RES_POOLCOLL_TABLE_HDLN:
nRet = RES_POOLCOLL_TABLE; break;
case RES_POOLCOLL_FRAME:
case RES_POOLCOLL_TABLE:
2000-09-18 23:08:29 +00:00
case RES_POOLCOLL_FOOTNOTE:
case RES_POOLCOLL_ENDNOTE:
case RES_POOLCOLL_JAKETADRESS:
case RES_POOLCOLL_SENDADRESS:
case RES_POOLCOLL_HEADER:
case RES_POOLCOLL_HEADERL:
case RES_POOLCOLL_HEADERR:
case RES_POOLCOLL_FOOTER:
case RES_POOLCOLL_FOOTERL:
case RES_POOLCOLL_FOOTERR:
case RES_POOLCOLL_LABEL:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_LABEL_ABB:
case RES_POOLCOLL_LABEL_TABLE:
case RES_POOLCOLL_LABEL_FRAME:
case RES_POOLCOLL_LABEL_DRAWING:
nRet = RES_POOLCOLL_LABEL; break;
}
break;
case COLL_REGISTER_BITS:
switch( nId )
{
case RES_POOLCOLL_REGISTER_BASE:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_TOX_USERH:
case RES_POOLCOLL_TOX_CNTNTH:
case RES_POOLCOLL_TOX_IDXH:
case RES_POOLCOLL_TOX_ILLUSH:
case RES_POOLCOLL_TOX_OBJECTH:
case RES_POOLCOLL_TOX_TABLESH:
case RES_POOLCOLL_TOX_AUTHORITIESH:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
default:
nRet = RES_POOLCOLL_REGISTER_BASE; break;
}
break;
case COLL_DOC_BITS:
nRet = RES_POOLCOLL_HEADLINE_BASE;
break;
case COLL_HTML_BITS:
nRet = RES_POOLCOLL_STANDARD;
break;
}
}
return nRet;
}
void SwDoc::RemoveAllFormatLanguageDependencies()
{
2011-02-07 20:21:18 +01:00
/* Restore the language independ pool defaults and styles. */
GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST );
SwTextFormatColl * pTextFormatColl = getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD );
pTextFormatColl->ResetFormatAttr( RES_PARATR_ADJUST );
2011-02-07 20:21:18 +01:00
/* koreans do not like SvxScriptItem(TRUE) */
pTextFormatColl->ResetFormatAttr( RES_PARATR_SCRIPTSPACE );
SvxFrameDirectionItem aFrameDir( SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR );
size_t nCount = GetPageDescCnt();
for( size_t i=0; i<nCount; ++i )
{
SwPageDesc& rDesc = GetPageDesc( i );
rDesc.GetMaster().SetFormatAttr( aFrameDir );
rDesc.GetLeft().SetFormatAttr( aFrameDir );
}
//#i16874# AutoKerning as default for new documents
GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */