summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/dialog/tplcitem.cxx8
-rw-r--r--sw/source/filter/html/htmlbas.cxx9
2 files changed, 5 insertions, 12 deletions
diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx
index aad39a00fffb..3d07fb25dcc4 100644
--- a/sfx2/source/dialog/tplcitem.cxx
+++ b/sfx2/source/dialog/tplcitem.cxx
@@ -102,12 +102,8 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
nWaterCanState = 0xff;
else if( eState == SfxItemState::DEFAULT )
{
- const SfxBoolItem *pStateItem = PTR_CAST(SfxBoolItem, pItem);
- assert(pStateItem); //BoolItem expected
- if (pStateItem)
- nWaterCanState = pStateItem->GetValue() ? 1 : 0;
- else
- nWaterCanState = 0xff;
+ const SfxBoolItem& rStateItem = dynamic_cast<const SfxBoolItem&>(*pItem);
+ nWaterCanState = rStateItem.GetValue() ? 1 : 0;
}
//not necessary if the last event is still on the way
if(!nUserEventId)
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 33503450d5d0..e91c1c099d70 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -278,10 +278,7 @@ void SwHTMLWriter::OutBasic()
SbxArray *pModules = pBasic->GetModules();
for( sal_uInt16 j=0; j<pModules->Count(); j++ )
{
- const SbModule *pModule = PTR_CAST( SbModule, pModules->Get(j) );
- assert(pModule); //Wo ist das Modul?
- if (!pModule)
- continue;
+ const SbModule &rModule = dynamic_cast<const SbModule&>(*pModules->Get(j));
OUString sLang(SVX_MACRO_LANGUAGE_STARBASIC);
ScriptType eType = STARBASIC;
@@ -302,9 +299,9 @@ void SwHTMLWriter::OutBasic()
.WriteCharPtr( "\">" );
}
- const OUString& rModName = pModule->GetName();
+ const OUString& rModName = rModule.GetName();
Strm().WriteCharPtr( SAL_NEWLINE_STRING ); // nicht einruecken!
- HTMLOutFuncs::OutScript( Strm(), GetBaseURL(), pModule->GetSource(),
+ HTMLOutFuncs::OutScript( Strm(), GetBaseURL(), rModule.GetSource(),
sLang, eType, aEmptyOUStr,
&rLibName, &rModName,
eDestEnc, &aNonConvertableCharacters );