summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-01-11 08:33:46 +0100
committerDavid Tardon <dtardon@redhat.com>2011-01-11 09:37:45 +0100
commitd2dbb88c42507ab20bb145818a26d18d614a51d6 (patch)
tree8282a2c9da443aa041fc641f2e6c5156acf4829f /sd/source
parent315ee6e56dc463bc2eef56b5a1b6c961855a8b6b (diff)
rhbz#668654 avoid division by 0
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainer.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
index b46dc325e..d281bee46 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
@@ -711,8 +711,11 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel (void)
if (*iDescriptor!=NULL && (*iDescriptor)->mpMasterPage != NULL)
{
Size aPageSize ((*iDescriptor)->mpMasterPage->GetSize());
- nWidth = aPageSize.Width();
- nHeight = aPageSize.Height();
+ OSL_ASSERT(aPageSize.Width() > 0 && aPageSize.Height() > 0);
+ if (aPageSize.Width() > 0)
+ nWidth = aPageSize.Width();
+ if (aPageSize.Height() > 0)
+ nHeight = aPageSize.Height();
mbFirstPageObjectSeen = true;
break;
}