summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-11-08 22:11:40 +0100
committerMichael Stahl <mstahl@redhat.com>2014-11-08 22:58:22 +0100
commit79416bdbeded822bf39ac017b5816fa9aa8b359e (patch)
tree5b19b325d5315514a669ed28b3576f00598d804d /sw/source
parent7bbda9b227c372898a80f75655a67eee0bdfabf3 (diff)
sw: fix un-safe casts in SwXNumberingRules
At least they check that the pointer they reinterpret-cast without checking the type isn't null! Change-Id: I07770e274598b1c476b4c297ac1d388b7ca576e5
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unosett.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index bd895823e24a..c9b4293b1010 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1938,15 +1938,15 @@ void SwXNumberingRules::SetPropertiesToNumFmt(
case 17: //UNO_NAME_BULLET_FONT,
{
assert( !pDocShell );
- awt::FontDescriptor* pDesc = (awt::FontDescriptor*)pProp->Value.getValue();
- if(pDesc)
+ awt::FontDescriptor desc;
+ if (pProp->Value >>= desc)
{
// #i93725#
// do not accept "empty" font
- if ( !pDesc->Name.isEmpty() )
+ if (!desc.Name.isEmpty())
{
vcl::Font aFont;
- SvxUnoFontDescriptor::ConvertToFont( *pDesc, aFont );
+ SvxUnoFontDescriptor::ConvertToFont(desc, aFont);
aFmt.SetBulletFont(&aFont);
}
}
@@ -2016,8 +2016,8 @@ void SwXNumberingRules::SetPropertiesToNumFmt(
case 21: //UNO_NAME_GRAPHIC_BITMAP,
{
assert( !pDocShell );
- uno::Reference< awt::XBitmap >* pBitmap = (uno::Reference< awt::XBitmap > *)pProp->Value.getValue();
- if(pBitmap)
+ uno::Reference<awt::XBitmap> xBitmap;
+ if (pProp->Value >>= xBitmap)
{
if(!pSetBrush)
{
@@ -2030,7 +2030,7 @@ void SwXNumberingRules::SetPropertiesToNumFmt(
pSetBrush = new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND);
}
- BitmapEx aBmp = VCLUnoHelper::GetBitmap( *pBitmap );
+ BitmapEx aBmp = VCLUnoHelper::GetBitmap(xBitmap);
Graphic aNewGr(aBmp);
pSetBrush->SetGraphic( aNewGr );
}
@@ -2043,13 +2043,13 @@ void SwXNumberingRules::SetPropertiesToNumFmt(
assert( !pDocShell );
if(!pSetSize)
pSetSize = new Size;
- if(pProp->Value.getValueType() == ::cppu::UnoType<awt::Size>::get())
+ awt::Size size;
+ if (pProp->Value >>= size)
{
- awt::Size* pSize = (awt::Size*)pProp->Value.getValue();
- pSize->Width = convertMm100ToTwip(pSize->Width);
- pSize->Height = convertMm100ToTwip(pSize->Height);
- pSetSize->Width() = pSize->Width;
- pSetSize->Height() = pSize->Height;
+ size.Width = convertMm100ToTwip(size.Width);
+ size.Height = convertMm100ToTwip(size.Height);
+ pSetSize->Width() = size.Width;
+ pSetSize->Height() = size.Height;
}
else
bWrongArg = true;