Kaydet (Commit) 08698950 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: Silence V522 warnings

V522 There might be dereferencing of a potential null pointer.

Change-Id: Ie4bc74a734a6d5a73838a27e0d80cc8e51595839
Reviewed-on: https://gerrit.libreoffice.org/70730
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 4acae16f
......@@ -220,8 +220,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
return s;
case codemaker::UnoType::Sort::PolymorphicStructTemplate:
if (args.size()
!= (dynamic_cast<
unoidl::PolymorphicStructTypeTemplateEntity * >(ent.get())->
!= (dynamic_cast<unoidl::PolymorphicStructTypeTemplateEntity&>(*ent).
getTypeParameters().size()))
{
throw CannotDumpException(
......
......@@ -392,7 +392,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void)
if(SfxItemState::SET == m_rOutAttrs.GetItemState(XATTR_FILLBITMAP, true, &pPoolItem))
{
pEntry.reset(new XBitmapEntry(dynamic_cast<const XFillBitmapItem*>(pPoolItem)->GetGraphicObject(), aName));
auto pFillBmpItem = dynamic_cast<const XFillBitmapItem*>(pPoolItem);
assert(pFillBmpItem);
pEntry.reset(new XBitmapEntry(pFillBmpItem->GetGraphicObject(), aName));
}
else
assert(!"SvxPatternTabPage::ClickAddHdl_Impl(), XBitmapEntry* pEntry == nullptr ?");
......
......@@ -41,7 +41,9 @@ namespace dbmm
MacroMigrationDialog& MacroMigrationPage::getDialog()
{
return *dynamic_cast< MacroMigrationDialog* >( GetParentDialog() );
auto pDialog = dynamic_cast<MacroMigrationDialog*>(GetParentDialog());
assert(pDialog);
return *pDialog;
}
// PreparationPage
......
......@@ -348,6 +348,7 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory()
if (pPreStoryID && !(pPreStoryID->IsNull()))
{
LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get());
assert(pPreStory);
return dynamic_cast<LwpPara*>(pPreStory->GetLastPara().obj(VO_PARA).get());
}
else
......
......@@ -132,8 +132,8 @@ void LwpFribSection::SetSectionName()
*/
LwpPageLayout* LwpFribSection::GetPageLayout()
{
if(GetSection())
return GetSection()->GetPageLayout();
if (LwpSection* pSection = GetSection())
return pSection->GetPageLayout();
return nullptr;
}
......
......@@ -191,6 +191,7 @@ void LwpRowLayout::Read()
void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
{
LwpTableLayout* pTableLayout = GetParentTableLayout();
assert(pTableLayout);
LwpTable* pTable = pTableLayout->GetTable();
//calculate the connected cell position
......
......@@ -757,8 +757,8 @@ void LwpTableLayout::RegisterStyle()
// the old code doesn't check if the LwpFoundry pointer is NULL,
// so the NULL pointer cause sodc freeze. Add code to check the pointer.
if (GetFoundry() && GetTable())
PutCellVals(GetFoundry(), GetTable()->GetObjectID());
if (GetFoundry())
PutCellVals(GetFoundry(), pTable->GetObjectID());
}
/**
* @short read table layout
......@@ -847,7 +847,9 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow(
rtl::Reference<XFTable> const & pXFTable, sal_uInt16 nStartHeadRow, sal_uInt16 nEndHeadRow)
{
sal_uInt16 nContentRow;
sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn());
LwpTable* pTable = GetTable();
assert(pTable);
sal_uInt8 nCol = static_cast<sal_uInt8>(pTable->GetColumn());
rtl::Reference<XFTable> pTmpTable( new XFTable );
ConvertTable(pTmpTable.get(),nStartHeadRow,nEndHeadRow,0,nCol);
......@@ -888,7 +890,9 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, rtl::Reference<XFTable>
{
sal_uInt16 i;
sal_uInt16 nRowNum = pTmpTable->GetRowCount();
sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn());
LwpTable* pTable = GetTable();
assert(pTable);
sal_uInt8 nCol = static_cast<sal_uInt8>(pTable->GetColumn());
rtl::Reference<XFRow> xXFRow(new XFRow);
......@@ -1360,8 +1364,10 @@ void LwpTableLayout::ConvertDefaultRow(rtl::Reference<XFTable> const & pXFTable,
rtl::Reference<XFCell> xCell;
if (m_pDefaultCellLayout)
{
LwpTable* pTable = GetTable();
assert(pTable);
xCell = m_pDefaultCellLayout->DoConvertCell(
GetTable()->GetObjectID(),nRowID,j+nStartCol);
pTable->GetObjectID(),nRowID,j+nStartCol);
}
else
{
......
......@@ -418,7 +418,7 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla
if ( pContainerModel->getControlType() == API_CONTROL_MULTIPAGE )
{
AxMultiPageModel* pMultiPage = dynamic_cast< AxMultiPageModel* >( pContainerModel );
if ( pMultiPage )
assert(pMultiPage);
{
BinaryXInputStream aXStrm( rStrg.openInputStream( "x" ), true );
pMultiPage->importPageAndMultiPageProperties( aXStrm, maControls.size() );
......
......@@ -409,6 +409,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
//set comment chars for last comment on slide
SlideFragmentHandler* comment_handler =
dynamic_cast<SlideFragmentHandler*>(xCommentsFragmentHandler.get());
assert(comment_handler);
// some comments have no text -> set empty string as text to avoid
// crash (back() on empty vector is undefined) and losing other
// comment data that might be there (author, position, timestamp etc.)
......
......@@ -3470,6 +3470,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
for(i = 0; i < SAL_N_ELEMENTS(pControl); ++i)
{
pObjs[i] = dynamic_cast<OUnoObject*>(pControl[i].get());
assert(pObjs[i]);
uno::Reference<beans::XPropertySet> xUnoProp(pObjs[i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
uno::Reference< report::XReportComponent> xShapeProp(pObjs[i]->getUnoShape(),uno::UNO_QUERY_THROW);
xUnoProp->setPropertyValue(PROPERTY_NAME,xShapeProp->getPropertyValue(PROPERTY_NAME));
......@@ -3541,6 +3542,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
xShapePropLabel->setPosition(aPosLabel);
}
OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl[0].get());
assert(pObj);
uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
xShapeProp->setName(xShapeProp->getName() + sDefaultName );
......
......@@ -1050,7 +1050,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
aNewViewOpt.SetGridOptions( aNewGridOpt );
rViewData.SetOptions( aNewViewOpt );
rViewData.GetDocument()->SetViewOptions( aNewViewOpt );
pDocSh->SetDocumentModified();
if (pDocSh)
pDocSh->SetDocumentModified();
bRepaint = true;
}
}
......
......@@ -1777,6 +1777,7 @@ ScVbaRange::HasFormula()
{
uno::Reference<uno::XInterface> xRanges( pThisRanges->queryFormulaCells( sheet::FormulaResult::ERROR | sheet::FormulaResult::VALUE | sheet::FormulaResult::STRING ), uno::UNO_QUERY_THROW );
ScCellRangesBase* pFormulaRanges = dynamic_cast< ScCellRangesBase * > ( xRanges.get() );
assert(pFormulaRanges);
// check if there are no formula cell, return false
if ( pFormulaRanges->GetRangeList().empty() )
return uno::makeAny(false);
......
......@@ -1727,6 +1727,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
if (pViewShell2 && pViewShell2 == this)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
assert(pTabViewShell);
ScInputHandler* pInputHdl = pTabViewShell->GetInputHandler();
if (pInputHdl && pInputHdl->IsFormulaMode())
{
......
......@@ -111,23 +111,26 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem,
double rel_x = rElem.x, rel_y = rElem.y;
// find anchor type by recursing though parents
Element* pAnchor = rElem.Parent;
while( pAnchor &&
! dynamic_cast<ParagraphElement*>(pAnchor) &&
! dynamic_cast<PageElement*>(pAnchor) )
Element* pAnchor = &rElem;
ParagraphElement* pParaElt = nullptr;
PageElement* pPage = nullptr;
while ((pAnchor = pAnchor->Parent))
{
pAnchor = pAnchor->Parent;
if ((pParaElt = dynamic_cast<ParagraphElement*>(pAnchor)))
break;
if ((pPage = dynamic_cast<PageElement*>(pAnchor)))
break;
}
if( pAnchor )
{
if( dynamic_cast<ParagraphElement*>(pAnchor) )
if (pParaElt)
{
rProps[ "text:anchor-type" ] = rElem.isCharacter
? OUString("character") : OUString("paragraph");
}
else
{
PageElement* pPage = dynamic_cast<PageElement*>(pAnchor);
assert(pPage); // guaranteed by the while loop above
rProps[ "text:anchor-type" ] = "page";
rProps[ "text:anchor-page-number" ] = OUString::number(pPage->PageNumber);
}
......
......@@ -1570,7 +1570,7 @@ bool SfxCommonTemplateDialog_Impl::Execute_Impl(
if ( (nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId) && (pTreeBox->IsVisible() || aFmtLb->GetSelectionCount() <= 1) )
{
const SfxUInt16Item *pFilterItem = dynamic_cast< const SfxUInt16Item* >(pItem);
OSL_ENSURE(pFilterItem, "SfxUINT16Item expected");
assert(pFilterItem);
SfxStyleSearchBits nFilterFlags = static_cast<SfxStyleSearchBits>(pFilterItem->GetValue()) & ~SfxStyleSearchBits::UserDefined;
if(nFilterFlags == SfxStyleSearchBits::Auto) // User Template?
nFilterFlags = static_cast<SfxStyleSearchBits>(pFilterItem->GetValue());
......
......@@ -1424,6 +1424,7 @@ std::shared_ptr<MetadatableUndo> Metadatable::CreateUndo() const
{
XmlIdRegistryDocument * pRegDoc(
dynamic_cast<XmlIdRegistryDocument*>( m_pReg ) );
assert(pRegDoc);
std::shared_ptr<MetadatableUndo> xUndo(
sfx2::XmlIdRegistryDocument::CreateUndo(*this) );
pRegDoc->RegisterCopy(*this, *xUndo, false);
......
......@@ -793,11 +793,14 @@ IMPL_LINK_NOARG( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, void )
aEdit->GrabFocus();
bool bInPlace = GetView()->GetViewFrame()->GetFrame().IsInPlace();
SmViewShell* pView = GetView();
assert(pView);
bool bInPlace = pView->GetViewFrame()->GetFrame().IsInPlace();
uno::Reference< frame::XFrame > xFrame( GetBindings().GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface());
if ( bInPlace )
{
uno::Reference< container::XChild > xModel( GetView()->GetDoc()->GetModel(), uno::UNO_QUERY_THROW );
uno::Reference<container::XChild> xModel(pView->GetDoc()->GetModel(),
uno::UNO_QUERY_THROW);
uno::Reference< frame::XModel > xParent( xModel->getParent(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XController > xParentCtrler( xParent->getCurrentController() );
uno::Reference< frame::XFramesSupplier > xParentFrame( xParentCtrler->getFrame(), uno::UNO_QUERY_THROW );
......
......@@ -6411,8 +6411,9 @@ void SwUiWriterTest::testTdf115013()
// Save it as DOCX & load it again
reload("Office Open XML Text", "mm-field.docx");
CPPUNIT_ASSERT(mxComponent.get());
pDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get())->GetDocShell()->GetDoc();
auto pXTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pXTextDocument);
pDoc = pXTextDocument->GetDocShell()->GetDoc();
CPPUNIT_ASSERT(pDoc);
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
CPPUNIT_ASSERT(pWrtShell);
......
......@@ -328,8 +328,9 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
pCNd && pCNd->IsTextNode() &&
GetItemState( RES_PARATR_LIST_ID, false, &pItem ) == SfxItemState::SET )
{
const OUString& sListId =
dynamic_cast<const SfxStringItem*>(pItem)->GetValue();
auto pStrItem = dynamic_cast<const SfxStringItem*>(pItem);
assert(pStrItem);
const OUString& sListId = pStrItem->GetValue();
if ( !sListId.isEmpty() &&
!pDstDoc->getIDocumentListsAccess().getListByName( sListId ) )
{
......
......@@ -1108,7 +1108,9 @@ static void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd )
{
// break the link of the corresponding section.
// the link is also removed from the link manager
pSectLnk->GetSectNode()->GetSection().BreakLink();
SwSectionNode* pSectNode = pSectLnk->GetSectNode();
assert(pSectNode);
pSectNode->GetSection().BreakLink();
// for robustness, because link is removed from the link manager
if ( n > rLnks.size() )
......
......@@ -4746,6 +4746,7 @@ namespace {
const SwNumRuleItem* pNumRuleItem =
dynamic_cast<const SwNumRuleItem*>(pItem);
assert(pNumRuleItem);
if ( !pNumRuleItem->GetValue().isEmpty() )
{
mbAddTextNodeToList = true;
......
......@@ -1065,8 +1065,12 @@ void SwXMLImport::MergeListsAtDocumentInsertPosition(SwDoc *pDoc)
if (! pListId2)
return;
const OUString& sListId1 = dynamic_cast<const SfxStringItem*>(pListId1)->GetValue();
const OUString& sListId2 = dynamic_cast<const SfxStringItem*>(pListId2)->GetValue();
auto pStringListId1 = dynamic_cast<const SfxStringItem*>(pListId1);
assert(pStringListId1);
const OUString& sListId1 = pStringListId1->GetValue();
auto pStringListId2 = dynamic_cast<const SfxStringItem*>(pListId2);
assert(pStringListId2);
const OUString& sListId2 = pStringListId2->GetValue();
const SwList* pList1 = pDoc->getIDocumentListsAccess().getListByName( sListId1 );
const SwList* pList2 = pDoc->getIDocumentListsAccess().getListByName( sListId2 );
......
......@@ -332,6 +332,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
case SID_SAVEDOC:
{
SwDocShell* pDocShell = GetDocShell();
assert(pDocShell);
SfxMedium* pMed = nullptr;
if(pDocShell->HasName())
pMed = pDocShell->GetMedium();
......@@ -366,7 +367,11 @@ void SwSrcView::Execute(SfxRequest& rReq)
SetSearchItem( static_cast<const SvxSearchItem&>(rItem));
StartSearchAndReplace( static_cast<const SvxSearchItem&>(rItem), rReq.IsAPI() );
if(aEditWin->IsModified())
GetDocShell()->GetDoc()->getIDocumentState().SetModified();
{
SwDocShell* pDocShell = GetDocShell();
assert(pDocShell);
pDocShell->GetDoc()->getIDocumentState().SetModified();
}
}
break;
case FN_REPEAT_SEARCH:
......@@ -433,6 +438,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
case SID_SAVEDOC:
{
SwDocShell* pDocShell = GetDocShell();
assert(pDocShell);
if(!pDocShell->IsModified())
rSet.DisableItem(nWhich);
}
......@@ -455,7 +461,9 @@ void SwSrcView::GetState(SfxItemSet& rSet)
case SID_SEARCH_OPTIONS:
{
SearchOptionFlags nOpt = SRC_SEARCHOPTIONS;
if(GetDocShell()->IsReadOnly())
SwDocShell* pDocShell = GetDocShell();
assert(pDocShell);
if (pDocShell->IsReadOnly())
nOpt &= ~SearchOptionFlags(SearchOptionFlags::REPLACE|SearchOptionFlags::REPLACE_ALL);
rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, static_cast<sal_uInt16>(nOpt) ) );
......@@ -646,6 +654,7 @@ void SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFlags )
{
SwDocShell* pDocSh = GetDocShell();
assert(pDocSh);
if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags )
{
pDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pNew, true, true );
......@@ -666,7 +675,9 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFl
SfxPrinter* SwSrcView::GetPrinter( bool bCreate )
{
return GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( bCreate );
SwDocShell* pDocSh = GetDocShell();
assert(pDocSh);
return pDocSh->GetDoc()->getIDocumentDeviceAccess().getPrinter(bCreate);
}
sal_Int32 SwSrcView::PrintSource(
......@@ -749,17 +760,17 @@ sal_Int32 SwSrcView::PrintSource(
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if ( rHint.GetId() == SfxHintId::ModeChanged ||
(
rHint.GetId() == SfxHintId::TitleChanged &&
!GetDocShell()->IsReadOnly() && aEditWin->IsReadonly()
)
)
if (rHint.GetId() == SfxHintId::ModeChanged || rHint.GetId() == SfxHintId::TitleChanged)
{
// Broadcast only comes once!
const SwDocShell* pDocSh = GetDocShell();
const bool bReadonly = pDocSh->IsReadOnly();
aEditWin->SetReadonly(bReadonly);
assert(pDocSh);
if (!(rHint.GetId() == SfxHintId::TitleChanged
&& (pDocSh->IsReadOnly() || !aEditWin->IsReadonly())))
{
// Broadcast only comes once!
const bool bReadonly = pDocSh->IsReadOnly();
aEditWin->SetReadonly(bReadonly);
}
}
SfxViewShell::Notify(rBC, rHint);
}
......
......@@ -3808,18 +3808,21 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
LanguageType nLang = LANGUAGE_DONTKNOW;
if (bLatin)
{
assert(pSet);
nLang = dynamic_cast< const SvxLanguageItem & >(pSet->Get( RES_CHRATR_LANGUAGE, false )).GetLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
aAllLangs.insert( nLang );
}
if (bAsian)
{
assert(pSet);
nLang = dynamic_cast< const SvxLanguageItem & >(pSet->Get( RES_CHRATR_CJK_LANGUAGE, false )).GetLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
aAllLangs.insert( nLang );
}
if (bComplex)
{
assert(pSet);
nLang = dynamic_cast< const SvxLanguageItem & >(pSet->Get( RES_CHRATR_CTL_LANGUAGE, false )).GetLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
aAllLangs.insert( nLang );
......
......@@ -530,6 +530,7 @@ void PdfExportTest::testTdf109143()
// Make sure it's re-compressed.
auto pLength = dynamic_cast<vcl::filter::PDFNumberElement*>(pXObject->Lookup("Length"));
CPPUNIT_ASSERT(pLength);
int nLength = pLength->GetValue();
// This failed: cropped TIFF-in-JPEG wasn't re-compressed, so crop was
// lost. Size was 59416, now is 11827.
......
......@@ -744,6 +744,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if( meOutDevType == OUTDEV_PRINTER )
{
Printer* pThis = dynamic_cast<Printer*>(this);
assert(pThis);
Point aPageOffset = pThis->GetPageOffsetPixel();
aPageOffset = Point( 0, 0 ) - aPageOffset;
Size aSize = pThis->GetPaperSizePixel();
......@@ -1107,6 +1108,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
else if( meOutDevType == OUTDEV_PRINTER )
{
Printer* pThis = dynamic_cast<Printer*>(this);
assert(pThis);
aPageOffset = pThis->GetPageOffsetPixel();
aPageOffset = Point( 0, 0 ) - aPageOffset;
aTmpSize = pThis->GetPaperSizePixel();
......
......@@ -660,6 +660,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
if ( pAction->GetType() == MetaActionType::BMPSCALE )
{
MetaBmpScaleAction* pScaleAction = dynamic_cast< MetaBmpScaleAction* >( pAction );
assert(pScaleAction);
aBmpEx = pScaleAction->GetBitmap();
aPos = pScaleAction->GetPoint();
aSize = pScaleAction->GetSize();
......@@ -667,6 +668,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
else
{
MetaBmpExScaleAction* pScaleAction = dynamic_cast< MetaBmpExScaleAction* >( pAction );
assert(pScaleAction);
aBmpEx = pScaleAction->GetBitmapEx();
aPos = pScaleAction->GetPoint();
aSize = pScaleAction->GetSize();
......
......@@ -2177,9 +2177,13 @@ public:
// get some other guys to leach off this context
VclPtrInstance<VirtualDevice> xVDev;
rtl::Reference<OpenGLContext> pContext = getImpl(xVDev)->GetOpenGLContext();
OpenGLSalGraphicsImpl* pImpl = getImpl(xVDev);
assert(pImpl);
rtl::Reference<OpenGLContext> pContext = pImpl->GetOpenGLContext();
VclPtrInstance<VirtualDevice> xVDev2;
rtl::Reference<OpenGLContext> pContext2 = getImpl(xVDev)->GetOpenGLContext();
OpenGLSalGraphicsImpl* pImpl2 = getImpl(xVDev2);
assert(pImpl2);
rtl::Reference<OpenGLContext> pContext2 = pImpl2->GetOpenGLContext();
// sharing the same off-screen context.
assert(pContext == pContext2);
......
......@@ -605,8 +605,6 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
do
{
XMLPropStyleContext* pDocStyle = nullptr;
// set style on shape
if(maDrawStyleName.isEmpty())
break;
......@@ -626,10 +624,10 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
OUString aStyleName = maDrawStyleName;
uno::Reference< style::XStyle > xStyle;
if( dynamic_cast<const XMLShapeStyleContext*>( pStyle ) )
XMLPropStyleContext* pDocStyle
= dynamic_cast<XMLShapeStyleContext*>(const_cast<SvXMLStyleContext*>(pStyle));
if (pDocStyle)
{
pDocStyle = const_cast<XMLShapeStyleContext*>(dynamic_cast<const XMLShapeStyleContext*>( pStyle ) );
if( pDocStyle->GetStyle().is() )
{
xStyle = pDocStyle->GetStyle();
......
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