diff options
author | Philipp Riemer <ruderphilipp@gmail.com> | 2013-06-10 21:58:09 +0200 |
---|---|---|
committer | Philipp Riemer <ruderphilipp@gmail.com> | 2013-06-10 22:00:58 +0200 |
commit | cef5c5dcb103e57be302957c530387dbbb042393 (patch) | |
tree | 2762313dc91c569d082ebd14a05119fcfc3ba7f7 | |
parent | 39f4f7d95391c5396a1fc92d48cb400c06db68b4 (diff) |
cleanup of existing code in sw/source/core/fields
- code formatting
- fixed alignment/spacing
- removal of commented out pieces
Change-Id: I3fc2be67edcad8e394966f1678fbbeca4537ff47
-rw-r--r-- | sw/source/core/fields/chpfld.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/fields/ddetbl.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/fields/expfld.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/fields/flddropdown.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/macrofld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/reffld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/textapi.cxx | 12 |
9 files changed, 29 insertions, 28 deletions
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx index 795cabe75dbf..e469c574ff72 100644 --- a/sw/source/core/fields/chpfld.cxx +++ b/sw/source/core/fields/chpfld.cxx @@ -128,7 +128,8 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum) for( xub_StrLen i = 0; i < sTitle.Len(); ++i ) if( ' ' > sTitle.GetChar( i ) ) sTitle.Erase( i--, 1 ); - }else + } + else { //End SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc(); diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index 647c2d297c89..3154c61cdfb0 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -50,12 +50,7 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType, sal_Bool bUpd const SwNode& rNd = *GetTabSortBoxes()[0]->GetSttNd(); if( rNd.GetNodes().IsDocNodes() ) { - // mba: swclient refactoring - this code shouldn't have done anything! - // the ModifyLock Flag is evaluated in SwModify only, though it was accessible via SwClient - // This has been fixed now -// aDepend.LockModify(); pDDEType->IncRefCnt(); -// aDepend.UnlockModify(); // update box content only if update flag is set (false in import) if (bUpdate) diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 3017c249bb1d..891e72cb384e 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1061,11 +1061,13 @@ String SwDocInfoField::Expand() const { if ( ( nSubType & 0xFF ) == DI_CUSTOM ) { - // custom properties currently need special treatment - // we don't have a secure way to detect "real" custom properties in Word Import of text fields - // so we treat *every* unknown property as a custom property, even the "built-in" section in Word's document summary information stream - // as these properties have not been inserted when the document summary information was imported, we do it here - // this approach is still a lot better than the old one to import such fields as "user fields" and simple text + // custom properties currently need special treatment + // We don't have a secure way to detect "real" custom properties in Word import of text + // fields, so we treat *every* unknown property as a custom property, even the "built-in" + // section in Word's document summary information stream as these properties have not been + // inserted when the document summary information was imported, we do it here. + // This approach is still a lot better than the old one to import such fields as + // "user fields" and simple text SwDocShell* pDocShell = GetDoc()->GetDocShell(); if( !pDocShell ) return aContent; @@ -1763,7 +1765,7 @@ void SwPostItField::SetPar2(const OUString& rStr) /// get the PostIt's text OUString SwPostItField::GetPar2() const { - return sTxt; + return sTxt; } const OUString& SwPostItField::GetInitials() const diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 3a2fa3e51fb9..6927a784d001 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -184,8 +184,6 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, { const_cast<SwTxtNode*>(pTxtNode)->MakeStartIndex( &rPos.nContent ); -// oder doch besser das Ende vom (Anker-)TextNode nehmen ?? -// ((SwTxtNode*)pTxtNode)->MakeEndIndex( &rPos.nContent ); } // do not break yet, might be as well in Header/Footer/Footnote/Fly @@ -852,12 +850,14 @@ void SwGetExpField::SetValue( const double& rAny ) sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny, GetFormat(), GetLanguage()); } -/* -------------------------------------------------- - Description: Find the index of the reference text - following the current field - nHint: search starting position after the current - field (or 0 if default) - --------------------------------------------------*/ + +/** Find the index of the reference text following the current field + * + * @param rFmt + * @param rDoc + * @param nHint search starting position after the current field (or 0 if default) + * @return + */ xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, unsigned nHint) { // diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index aa71ff33a465..2bd1b7338858 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -112,7 +112,6 @@ std::vector<String>* SwFieldType::pFldNames = 0; /* RES_COMBINED_CHARS */ TYP_COMBINED_CHARS, /* RES_DROPDOWN */ TYP_DROPDOWN }; - // ????? TYP_USRINPFLD, const String& SwFieldType::GetTypeStr(sal_uInt16 nTypeId) { diff --git a/sw/source/core/fields/flddropdown.cxx b/sw/source/core/fields/flddropdown.cxx index 3fd75d615f35..6f6517a1e358 100644 --- a/sw/source/core/fields/flddropdown.cxx +++ b/sw/source/core/fields/flddropdown.cxx @@ -70,7 +70,7 @@ String SwDropDownField::Expand() const if ( aIt != aValues.end()) sSelect = *aIt; } - //if still no list value is available a default text of 10 spaces is to be set + // if still no list value is available a default text of 10 spaces is to be set if(!sSelect.Len()) sSelect.AppendAscii ( RTL_CONSTASCII_STRINGPARAM (" ")); return sSelect; diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index 604376cc6a71..a073a842d229 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -197,7 +197,7 @@ bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return true; } -// create an internally used macro name from the library and macro name parts +/// create an internally used macro name from the library and macro name parts void SwMacroField::CreateMacroString( OUString& rMacro, const String& rMacroName, diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 5360de70ccef..19743c5f9514 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -742,7 +742,7 @@ void SwGetRefField::ConvertProgrammaticToUIName() { SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc(); const String& rPar1 = GetPar1(); - //don't convert when the name points to an existing field type + // don't convert when the name points to an existing field type if(!pDoc->GetFldType(RES_SETEXPFLD, rPar1, false)) { sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromProgName( rPar1, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx index 525ad9434c97..0b3a9544885a 100644 --- a/sw/source/core/fields/textapi.cxx +++ b/sw/source/core/fields/textapi.cxx @@ -37,10 +37,14 @@ static const SvxItemPropertySet* ImplGetSvxTextPortionPropertySet() SVX_UNOEDIT_FONT_PROPERTIES, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_PARA_PROPERTIES, - {MAP_CHAR_LEN("TextField"), EE_FEATURE_FIELD, &::getCppuType((const uno::Reference< text::XTextField >*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN("TextPortionType"), WID_PORTIONTYPE, &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0 }, - {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, - {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, + {MAP_CHAR_LEN("TextField"), EE_FEATURE_FIELD, + &::getCppuType((const uno::Reference< text::XTextField >*)0), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN("TextPortionType"), WID_PORTIONTYPE, + &::getCppuType((const OUString*)0), beans::PropertyAttribute::READONLY, 0 }, + {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, + &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0), 0, 0}, + {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, + &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >*)0), 0, 0}, {0,0,0,0,0,0} }; static SvxItemPropertySet aSvxTextPortionPropertySet( aSvxTextPortionPropertyMap, EditEngine::GetGlobalItemPool() ); |