File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public:
76
76
77
77
/* * Return the preview size in pixels.
78
78
*/
79
- Size const & GetPreviewSizePixel () const ;
79
+ const Size & GetPreviewSizePixel () const ;
80
80
81
81
enum PreviewState
82
82
{
Original file line number Diff line number Diff line change @@ -586,7 +586,8 @@ css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidt
586
586
{
587
587
// there is no way to get margin of item programatically, we use value provided in ui file.
588
588
const int nMargin = 6 ;
589
- sal_Int32 nColumnCount = nWidth / (mxPreviewIconView->get_item_width () + (5 * nMargin));
589
+ const Size& previewSize = mpContainer->GetPreviewSizePixel ();
590
+ sal_Int32 nColumnCount = nWidth / (previewSize.Width () + (2 * nMargin));
590
591
if (nColumnCount < 1 )
591
592
nColumnCount = 1 ;
592
593
@@ -595,8 +596,7 @@ css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidt
595
596
if (nRowCount < 1 )
596
597
nRowCount = 1 ;
597
598
598
- sal_Int32 nPreferedHeight
599
- = nRowCount * (mxPreviewIconView->get_rect (nTotalItems - 1 ).GetHeight () + (2 * nMargin));
599
+ sal_Int32 nPreferedHeight = nRowCount * (previewSize.getHeight () + (4 * nMargin));
600
600
return css::ui::LayoutSize (nPreferedHeight, nPreferedHeight, nPreferedHeight);
601
601
}
602
602
You can’t perform that action at this time.
0 commit comments