Kaydet (Commit) d8075d15 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

sw html: use scoped_ptr in htmlatr

Change-Id: I54eb81b3dff76881fc6ed79aca1df6f9687083f8
üst 2039fbdd
...@@ -74,7 +74,9 @@ ...@@ -74,7 +74,9 @@
#include <numrule.hxx> #include <numrule.hxx>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
using namespace ::com::sun::star; #include <boost/scoped_ptr.hpp>
using namespace css;
HTMLOutEvent aAnchorEventTable[] = HTMLOutEvent aAnchorEventTable[] =
{ {
...@@ -197,7 +199,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1ScriptForScriptType( sal_uInt16 nScriptType ) ...@@ -197,7 +199,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1ScriptForScriptType( sal_uInt16 nScriptType )
struct SwHTMLTxtCollOutputInfo struct SwHTMLTxtCollOutputInfo
{ {
OString aToken; // auszugendens End-Token OString aToken; // auszugendens End-Token
SfxItemSet *pItemSet; // harte Attributierung boost::scoped_ptr<SfxItemSet> pItemSet; // harte Attributierung
sal_Bool bInNumBulList; // in einer Aufzaehlungs-Liste; sal_Bool bInNumBulList; // in einer Aufzaehlungs-Liste;
sal_Bool bParaPossible; // ein </P> darf zusaetzlich ausgegeben werden sal_Bool bParaPossible; // ein </P> darf zusaetzlich ausgegeben werden
...@@ -205,7 +207,7 @@ struct SwHTMLTxtCollOutputInfo ...@@ -205,7 +207,7 @@ struct SwHTMLTxtCollOutputInfo
sal_Bool bOutDiv; // write a </DIV> sal_Bool bOutDiv; // write a </DIV>
SwHTMLTxtCollOutputInfo() : SwHTMLTxtCollOutputInfo() :
pItemSet( 0 ), pItemSet(NULL),
bInNumBulList( sal_False ), bInNumBulList( sal_False ),
bParaPossible( sal_False ), bParaPossible( sal_False ),
bOutPara( sal_False ), bOutPara( sal_False ),
...@@ -220,7 +222,6 @@ struct SwHTMLTxtCollOutputInfo ...@@ -220,7 +222,6 @@ struct SwHTMLTxtCollOutputInfo
SwHTMLTxtCollOutputInfo::~SwHTMLTxtCollOutputInfo() SwHTMLTxtCollOutputInfo::~SwHTMLTxtCollOutputInfo()
{ {
delete pItemSet;
} }
SwHTMLFmtInfo::SwHTMLFmtInfo( const SwFmt *pF, SwDoc *pDoc, SwDoc *pTemplate, SwHTMLFmtInfo::SwHTMLFmtInfo( const SwFmt *pF, SwDoc *pDoc, SwDoc *pTemplate,
...@@ -585,17 +586,17 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, ...@@ -585,17 +586,17 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
// Falls noetig, die harte Attributierung der Vorlage uebernehmen // Falls noetig, die harte Attributierung der Vorlage uebernehmen
if( pFmtInfo->pItemSet ) if( pFmtInfo->pItemSet )
{ {
OSL_ENSURE( !rInfo.pItemSet, "Wo kommt der Item-Set her?" ); OSL_ENSURE( !rInfo.pItemSet.get(), "Wo kommt der Item-Set her?" );
rInfo.pItemSet = new SfxItemSet( *pFmtInfo->pItemSet ); rInfo.pItemSet.reset(new SfxItemSet( *pFmtInfo->pItemSet ));
} }
// und noch die harte Attributierung des Absatzes dazunehmen // und noch die harte Attributierung des Absatzes dazunehmen
if( pNodeItemSet ) if( pNodeItemSet )
{ {
if( rInfo.pItemSet ) if( rInfo.pItemSet.get() )
rInfo.pItemSet->Put( *pNodeItemSet ); rInfo.pItemSet->Put( *pNodeItemSet );
else else
rInfo.pItemSet = new SfxItemSet( *pNodeItemSet ); rInfo.pItemSet.reset(new SfxItemSet( *pNodeItemSet ));
} }
// den unteren Absatz-Abstand brauchen wir noch // den unteren Absatz-Abstand brauchen wir noch
...@@ -616,10 +617,10 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, ...@@ -616,10 +617,10 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
else else
aULSpaceItem.SetUpper( rHWrt.nHeaderFooterSpace ); aULSpaceItem.SetUpper( rHWrt.nHeaderFooterSpace );
if( !rInfo.pItemSet ) if (!rInfo.pItemSet.get())
rInfo.pItemSet = new SfxItemSet( {
*rFmt.GetAttrSet().GetPool(), rInfo.pItemSet.reset(new SfxItemSet(*rFmt.GetAttrSet().GetPool(), RES_UL_SPACE, RES_UL_SPACE));
RES_UL_SPACE, RES_UL_SPACE ); }
rInfo.pItemSet->Put( aULSpaceItem ); rInfo.pItemSet->Put( aULSpaceItem );
} }
rHWrt.bOutHeader = sal_False; rHWrt.bOutHeader = sal_False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment