diff options
author | Michael Stahl <mst@openoffice.org> | 2010-05-21 15:21:49 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-05-21 15:21:49 +0200 |
commit | 966769301dad40137cb71724697eb14ae74341be (patch) | |
tree | 2fe6ee429f9b5afd721b63c7557c79e5519ea798 /sw | |
parent | 8f3bf8281479f4cdd8f65a53de66208f07fb77f7 (diff) |
sw33bf04: #i85766#: prevent field expansion in clipboard:
SwField: add a String member to cache the value.
SwField: wrap Expand() and Copy() methods to use/update cache.
update all callers to pass the clipboard flag to new SwField::ExpandField().
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/fldbas.hxx | 15 | ||||
-rw-r--r-- | sw/inc/txtfld.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/tox/txmsrt.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrfld.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/undo/SwUndoField.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ascii/ascatr.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfldw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtfatr.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 29 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin2.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldpage.cxx | 14 |
22 files changed, 107 insertions, 105 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index e7bea38aae..500a4f1b80 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -305,12 +305,17 @@ inline void SwFieldType::UpdateFlds() const class SW_DLLPUBLIC SwField { +private: + mutable String m_Cache; /// #i85766# cached expansion (for clipboard) USHORT nLang; // Immer ueber SetLanguage aendern! BOOL bIsAutomaticLanguage; sal_uInt32 nFormat; SwFieldType* pType; + virtual String Expand() const = 0; + virtual SwField* Copy() const = 0; + protected: void SetFormat(sal_uInt32 nSet) {nFormat = nSet;} @@ -325,12 +330,16 @@ public: // neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt) virtual SwFieldType* ChgTyp( SwFieldType* ); - // Expandierung fuer die Anzeige - virtual String Expand() const = 0; + /** expand the field. + @param bInClipboard field is in clipboard document? + @return the generated text (suitable for display) + */ + String ExpandField(bool const bInClipboard) const; // liefert den Namen oder den Inhalt virtual String GetCntnt(BOOL bName = FALSE) const; - virtual SwField* Copy() const = 0; + + SwField * CopyField() const; // ResId USHORT Which() const diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx index f9918e2c90..6ba1e25966 100644 --- a/sw/inc/txtfld.hxx +++ b/sw/inc/txtfld.hxx @@ -41,7 +41,8 @@ class SwTxtFld : public SwTxtAttr SwTxtNode * m_pTxtNode; public: - SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStart ); + SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart, + bool const bInClipboard); virtual ~SwTxtFld(); void CopyFld( SwTxtFld *pDest ) const; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 681dd7a04c..801c15e12b 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -34,9 +34,7 @@ #include <editeng/lrspitem.hxx> #include <editeng/adjitem.hxx> #include <editeng/brkitem.hxx> -#ifndef _SVX_SVDOBJ_HXX #include <svx/svdobj.hxx> -#endif #include <crsrsh.hxx> #include <doc.hxx> #include <pagefrm.hxx> @@ -718,7 +716,8 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField( (SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) ); - pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() ); + pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(), + pDoc->IsClipBoard() ); pTxtFld->ChgTxtNode( pTNd ); } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 7001dd5ca4..bf9f2e5cf0 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -145,7 +145,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, // Fuer das Ende merken wir uns die Ersetzungen und entferenen // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() || - !((SwTxtFld*)pHt)->GetFld().GetFld()->Expand().Len(); + !(static_cast<SwTxtFld const*>(pHt) + ->GetFld().GetFld()->ExpandField( + rNd.GetDoc()->IsClipBoard()).Len()); if ( bEmpty && nStart == nAkt ) { rArr.Insert( nAkt, rArr.Count() ); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 54cb12e9db..9d907b9896 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1241,13 +1241,18 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize, // Eintrag in den HashTable eintragen // Eintrag vorhanden ? pFnd = Find( rName, ppHashTbl, rTblSize, &nPos ); + String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) + { // Eintrag in der HashTabelle aendern - ((_HashStr*)pFnd)->aSetStr = pFld->Expand(); + static_cast<_HashStr*>(pFnd)->aSetStr = value; + } else + { // neuen Eintrag einfuegen *(ppHashTbl + nPos ) = new _HashStr( rName, - pFld->Expand(), (_HashStr*)*(ppHashTbl + nPos)); + value, static_cast<_HashStr *>(*(ppHashTbl + nPos))); + } } break; } @@ -1413,13 +1418,18 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) // Eintrag vorhanden ? USHORT nPos; SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos ); + String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) + { // Eintrag in der HashTabelle aendern - ((_HashStr*)pFnd)->aSetStr = pFld->Expand(); + static_cast<_HashStr*>(pFnd)->aSetStr = value; + } else + { // neuen Eintrag einfuegen *(pHashStrTbl + nPos ) = new _HashStr( rName, - pFld->Expand(), (_HashStr*)*(pHashStrTbl + nPos)); + value, static_cast<_HashStr *>(*(pHashStrTbl + nPos))); + } } break; case RES_GETEXPFLD: @@ -2724,7 +2734,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, //pDstFld->ChangeFormat( rSrcFld.GetFormat() ); //pDstFld->SetLanguage( rSrcFld.GetLanguage() ); - SwField * pNewFld = rSrcFld.Copy(); + SwField * pNewFld = rSrcFld.CopyField(); pDstFmtFld->SetFld(pNewFld); switch( nFldWhich ) diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index ff077f1018..87393cfcea 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -31,14 +31,10 @@ #include <hintids.hxx> -#ifndef _SVX_TSTPITEM_HXX //autogen #include <editeng/tstpitem.hxx> -#endif #include <editeng/lrspitem.hxx> #include <editeng/scripttypeitem.hxx> -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include <com/sun/star/i18n/ScriptType.hdl> -#endif #include <txatbase.hxx> #include <txtftn.hxx> #include <fmtftn.hxx> @@ -461,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, const SwField* const pFld = pAttr->GetFld().GetFld(); if (pFld) { - sExp += pFld->Expand(); + sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard()); } } } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 86df811542..8c5b02794e 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -42,9 +42,7 @@ #include <expfld.hxx> #include <flddat.hxx> #include <swundo.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <swddetbl.hxx> #include <hints.hxx> @@ -226,7 +224,8 @@ void SwEditShell::FieldToText( SwFieldType* pType ) *pFmtFld->GetTxtFld()->GetStart() ); // Feldinhalt durch Text ersetzen - String aEntry( pFmtFld->GetFld()->Expand() ); + String const aEntry( + pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) ); pPaM->SetMark(); pPaM->Move( fnMoveForward ); GetDoc()->DeleteRange( *pPaM ); diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index d92d8ce0e5..fb98a31c93 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -203,7 +203,8 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const break; default: - nRet = rCalcPara.rCalc.Calculate( pFld->Expand() ).GetDouble(); + String const value(pFld->ExpandField(pDoc->IsClipBoard())); + nRet = rCalcPara.rCalc.Calculate(value).GetDouble(); } } else diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index db704276ba..7abd94ebf5 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -437,6 +437,23 @@ BOOL SwField::IsFixed() const return bRet; } +String SwField::ExpandField(bool const bInClipboard) const +{ + if (!bInClipboard) // #i85766# do not expand fields in clipboard documents + { + m_Cache = Expand(); + } + return m_Cache; +} + +SwField * SwField::CopyField() const +{ + SwField *const pNew = Copy(); + // #i85766# cache expansion of source (for clipboard) + pNew->m_Cache = Expand(); + return pNew; +} + /*-------------------------------------------------------------------- Beschreibung: Numerierung expandieren --------------------------------------------------------------------*/ diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 55399e4ea8..e3d80b4af6 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -870,8 +870,9 @@ USHORT SwTOXAuthority::GetLevel() const -----------------------------------------------------------------------*/ void SwTOXAuthority::_GetText( String& rTxt, String& ) { - // - rTxt = m_rField.GetFld()->Expand(); + bool const isClipBoard( + m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard()); + rTxt = m_rField.GetFld()->ExpandField(isClipBoard); } /* -----------------21.09.99 12:50------------------- diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index ce1dd11493..f2e98fd0f4 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -32,6 +32,7 @@ #include <fmtfld.hxx> #include <txtfld.hxx> #include <docufld.hxx> +#include <doc.hxx> #include "reffld.hxx" #include "ddefld.hxx" @@ -68,7 +69,7 @@ SwFmtFld::SwFmtFld( const SwField &rFld ) SwClient( rFld.GetTyp() ), pTxtAttr( 0 ) { - pField = rFld.Copy(); + pField = rFld.CopyField(); } // #i24434# @@ -83,7 +84,7 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAttr ) if(rAttr.GetFld()) { rAttr.GetFld()->GetTyp()->Add(this); - pField = rAttr.GetFld()->Copy(); + pField = rAttr.GetFld()->CopyField(); } } @@ -254,9 +255,10 @@ BOOL SwFmtFld::IsProtect() const |* *************************************************************************/ -SwTxtFld::SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStartPos ) +SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos, + bool const bInClipboard) : SwTxtAttr( rAttr, nStartPos ) - , m_aExpand( rAttr.GetFld()->Expand() ) + , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) ) , m_pTxtNode( 0 ) { rAttr.pTxtAttr = this; @@ -283,7 +285,8 @@ void SwTxtFld::Expand() const ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" ); const SwField* pFld = GetFld().GetFld(); - XubString aNewExpand( pFld->Expand() ); + XubString aNewExpand( + pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) ); if( aNewExpand == m_aExpand ) { diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 8796e57b6d..85d92ee613 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2994,8 +2994,10 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt, rTxt.Erase( nPos, 1 ); if( bExpandFlds ) { - const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld(). - GetFld()->Expand() ); + const XubString aExpand( + static_cast<SwTxtFld const*>(pAttr)->GetFld() + .GetFld()->ExpandField( + GetDoc()->IsClipBoard())); rTxt.Insert( aExpand, nPos ); nPos = nPos + aExpand.Len(); nEndPos = nEndPos + aExpand.Len(); @@ -3142,7 +3144,9 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, { case RES_TXTATR_FIELD: { - const XubString aExpand( ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand() ); + XubString const aExpand( + static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld() + ->ExpandField(GetDoc()->IsClipBoard())); if( aExpand.Len() ) { aDestIdx++; // dahinter einfuegen; @@ -3238,7 +3242,9 @@ const ModelToViewHelper::ConversionMap* const SwTxtAttr* pAttr = (*pSwpHints2)[i]; if ( RES_TXTATR_FIELD == pAttr->Which() ) { - const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().GetFld()->Expand() ); + const XubString aExpand( + static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld() + ->ExpandField(GetDoc()->IsClipBoard())); if ( aExpand.Len() > 0 ) { const xub_StrLen nFieldPos = *pAttr->GetStart(); diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index d5fbf01160..b48de41078 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1042,7 +1042,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd ); break; case RES_TXTATR_FIELD: - pNew = new SwTxtFld( (SwFmtFld&)rNew, nStt ); + pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt, + rDoc.IsClipBoard() ); break; case RES_TXTATR_FLYCNT: { diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx index ccc1f4d211..9d9c74b1e5 100644 --- a/sw/source/core/undo/SwUndoField.cxx +++ b/sw/source/core/undo/SwUndoField.cxx @@ -63,12 +63,14 @@ SwPosition SwUndoField::GetPosition() } SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos, - const SwField & _aOldField, - const SwField & _aNewField, + const SwField & rOldField, + const SwField & rNewField, SwMsgPoolItem * _pHnt, BOOL _bUpdate, SwUndoId _nId) - : SwUndoField(rPos,_nId), pOldField(_aOldField.Copy()), - pNewField(_aNewField.Copy()), pHnt(_pHnt), - bUpdate(_bUpdate) + : SwUndoField(rPos,_nId) + , pOldField(rOldField.CopyField()) + , pNewField(rNewField.CopyField()) + , pHnt(_pHnt) + , bUpdate(_bUpdate) { ASSERT(pOldField, "No old field!"); ASSERT(pNewField, "No new field!"); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 675c59c727..8399b5b94c 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -124,7 +124,8 @@ BOOL SwASC_AttrIter::OutAttr( xub_StrLen nSwPos ) switch( pHt->Which() ) { case RES_TXTATR_FIELD: - sOut = ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand(); + sOut = static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld() + ->ExpandField(rWrt.pDoc->IsClipBoard()); break; case RES_TXTATR_FTN: diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index cc0ee03a24..32234b7929 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -305,7 +305,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld, } // Inhalt des Feldes ausgeben - String sExpand( pFld->Expand() ); + String const sExpand( pFld->ExpandField(rWrt.pDoc->IsClipBoard()) ); sal_Bool bNeedsCJKProcessing = sal_False; if( sExpand.Len() ) { diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index 528b0d82d1..e73ee51a46 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -2902,7 +2902,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt ) case RES_HIDDENTXTFLD: if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() ) - RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(), + RTFOutFuncs::Out_String( rWrt.Strm(), + pFld->ExpandField(rWrt.pDoc->IsClipBoard()), rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); else { @@ -2958,7 +2959,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt ) rWrt.Strm() >> cCh; if( ' ' != cCh ) // vorweg immer einen Trenner rWrt.Strm() << ' '; - RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(), + RTFOutFuncs::Out_String( rWrt.Strm(), + pFld->ExpandField(rWrt.pDoc->IsClipBoard()), rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); } break; @@ -2967,7 +2969,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt ) if( aFldStt.Len() ) { rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' '; - RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(), + RTFOutFuncs::Out_String( rWrt.Strm(), + pFld->ExpandField(rWrt.pDoc->IsClipBoard()), rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ); rWrt.Strm() << "}}"; rRTFWrt.bOutFmtAttr = FALSE; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 61e8d6016c..aa8b345fe6 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1743,9 +1743,9 @@ static void InsertSpecialChar( WW8Export& rWrt, BYTE c, aItems.GetData()); } -String lcl_GetExpandedField(const SwField &rFld) +String lcl_GetExpandedField(const SwField &rFld, SwDoc const& rDoc) { - String sRet(rFld.Expand()); + String sRet(rFld.ExpandField(rDoc.IsClipBoard())); //replace LF 0x0A with VT 0x0B sRet.SearchAndReplaceAll(0x0A, 0x0B); @@ -1871,7 +1871,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType, { String sOut; if( pFld ) - sOut = lcl_GetExpandedField(*pFld); + sOut = lcl_GetExpandedField(*pFld, *pDoc); else sOut = rFldCmd; if( sOut.Len() ) @@ -2598,7 +2598,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) sStr.APPEND_CONST_ASC( "\" " ); m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END ); - String sVar = lcl_GetExpandedField( rFld ); + String sVar = lcl_GetExpandedField( rFld, *GetExport().pDoc ); if ( sVar.Len() ) { if ( m_rWW8Export.IsUnicode() ) @@ -2614,7 +2614,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) void WW8AttributeOutput::WriteExpand( const SwField* pFld ) { - String sExpand( lcl_GetExpandedField( *pFld ) ); + String sExpand( lcl_GetExpandedField( *pFld, *GetExport().pDoc ) ); if ( m_rWW8Export.IsUnicode() ) SwWW8Writer::WriteString16( m_rWW8Export.Strm(), sExpand, false ); else diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index e423ca70ba..ee129df190 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -33,15 +33,10 @@ #include "dbinsdlg.hxx" -#ifndef INCLUDED_MEMORY #include <memory> -#define INCLUDED_MEMORY -#endif -#ifndef INCLUDED_FLOAT_H #include <float.h> -#define INCLUDED_FLOAT_H -#endif + #include <hintids.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -65,9 +60,7 @@ #include <svl/stritem.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> -#ifndef __SV_MNEMONIC_HXX #include <vcl/mnemonic.hxx> -#endif #include <svl/style.hxx> #include <svl/zformat.hxx> #include <svx/htmlmode.hxx> @@ -78,24 +71,16 @@ #include <editeng/boxitem.hxx> #include <svx/rulritem.hxx> #include <swdbtoolsclient.hxx> -#ifndef _SWTABLEREP_HXX //autogen #include <tabledlg.hxx> -#endif #include <fmtclds.hxx> #include <tabcol.hxx> #include <uiitems.hxx> #include <viewopt.hxx> #include <uitool.hxx> #include <wrtsh.hxx> -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <tblafmt.hxx> #include <cellatr.hxx> #include <swtable.hxx> @@ -108,19 +93,11 @@ #include <poolfmt.hxx> #include <crsskip.hxx> -#ifndef _DBINSDLG_HRC #include <dbinsdlg.hrc> -#endif -#ifndef _DBUI_HRC #include <dbui.hrc> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #include <cfgid.h> #include <SwStyleNameMapper.hxx> #include <comphelper/uno3.hxx> @@ -1380,8 +1357,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, case _DB_Column::DB_COL_FIELD: { - SwDBField* pFld = (SwDBField*)pDBCol->DB_ColumnData. - pField->Copy(); + SwDBField *const pFld = static_cast<SwDBField *>( + pDBCol->DB_ColumnData.pField->CopyField()); double nValue = DBL_MAX; Reference< XPropertySet > xColumnProps; diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index 4ee301e9f2..1bfa052359 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -35,9 +35,7 @@ #include <stdio.h> #endif -#ifndef _HELP_HXX //autogen #include <vcl/help.hxx> -#endif #include <svl/stritem.hxx> #include <unotools/securityoptions.hxx> #include <tools/urlobj.hxx> @@ -46,24 +44,15 @@ #include <editeng/flditem.hxx> #include <svl/urihelper.hxx> #include <svx/svdotext.hxx> -#ifndef _OUTLINER_HXX //autogen -#define _EEITEMID_HXX #include <editeng/outliner.hxx> -#endif #include <svl/itemiter.hxx> #include <svx/svdview.hxx> #include <svx/svdpagv.hxx> #include <swmodule.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <edtwin.hxx> #include <dpage.hxx> #include <shellres.hxx> @@ -80,12 +69,8 @@ #include <txttxmrk.hxx> #include <uitool.hxx> #include <viewopt.hxx> -#ifndef _DOCVW_HRC #include <docvw.hrc> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif #include <postit.hxx> #include <PostItMgr.hxx> @@ -320,7 +305,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) { USHORT nOldSubType = pFld->GetSubType(); ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD); - sTxt = pFld->Expand(); + sTxt = + pFld->ExpandField(rSh.GetDoc()->IsClipBoard()); ((SwField*)pFld)->SetSubType(nOldSubType); } break; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 42b9bc43e6..4e707ce6ce 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1435,7 +1435,7 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat, } else { - pTmpFld = pCurFld->Copy(); + pTmpFld = pCurFld->CopyField(); bDelete = true; } diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 385ed8d60f..6c9ded39aa 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -42,28 +42,16 @@ #include <fmtfld.hxx> #include <viewopt.hxx> #include <fldedt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <expfld.hxx> -#ifndef _FLDTDLG_HXX #include <fldtdlg.hxx> -#endif -#ifndef _FLDPAGE_HXX #include <fldpage.hxx> -#endif #include <docufld.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <sfx2/bindings.hxx> using namespace ::com::sun::star; @@ -218,7 +206,7 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1, } else // Feld aendern { - SwField * pTmpFld = m_pCurFld->Copy(); + SwField *const pTmpFld = m_pCurFld->CopyField(); String sPar1(rPar1); String sPar2(rPar2); |