[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source
Xisco Fauli
anistenis at gmail.com
Mon May 22 08:31:45 UTC 2017
cui/source/tabpages/tpbitmap.cxx | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
New commits:
commit 221de7cfdb6c6b6a4879162652bf842c4358f9eb
Author: Xisco Fauli <anistenis at gmail.com>
Date: Tue May 16 12:25:24 2017 +0200
tdf#107877: Don't crash if all bitmaps are deleted
Change-Id: Ie21f8cf1ead7c75017ee09436102f87f5d5dc04c
Reviewed-on: https://gerrit.libreoffice.org/37673
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
(cherry picked from commit 9d55ce72b69934d17360142f88a699397e0aa41f)
Reviewed-on: https://gerrit.libreoffice.org/37724
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index a703aef8ede2..5f56ad4a487c 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -525,21 +525,29 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
}
}
- BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
- Size aTempBitmapSize = aBmpEx.GetSizePixel();
- const double fUIScale = ( (mpView && mpView->GetModel()) ? double(mpView->GetModel()->GetUIScale()) : 1.0);
+ if(pGraphicObject)
+ {
+ BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
+ Size aTempBitmapSize = aBmpEx.GetSizePixel();
+ const double fUIScale = ( (mpView && mpView->GetModel()) ? double(mpView->GetModel()->GetUIScale()) : 1.0);
- rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
- rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
- CalculateBitmapPresetSize();
- ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
- ModifyBitmapPositionHdl( *m_pPositionLB );
+ rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
+ rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
+ CalculateBitmapPresetSize();
+ ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
+ ModifyBitmapPositionHdl( *m_pPositionLB );
- m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
- m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
+ m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
+ m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
+
+ m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_pCtlBitmapPreview->Invalidate();
+ }
+ else
+ {
+ SAL_WARN("cui.tabpages", "SvxBitmapTabPage::ModifyBitmapHdl(): null pGraphicObject");
+ }
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
}
IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
More information about the Libreoffice-commits
mailing list