sc: load BitmapEx resources instead of Image ones

Change-Id: If10ae4238a580ab6d19287968aecbf29acbd550e
This commit is contained in:
Caolán McNamara 2017-01-19 09:38:10 +00:00
parent f6572fa96c
commit f0421b64cb
11 changed files with 98 additions and 101 deletions

View File

@ -994,25 +994,25 @@
#define BMP_START (STR_END)
// navigator
#define RID_IMG_DROP_URL (BMP_START + 2)
#define RID_IMG_DROP_LINK (BMP_START + 3)
#define RID_IMG_DROP_COPY (BMP_START + 4)
#define RID_IMG_SELECT_CURRENT (BMP_START + 8)
#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9)
#define RID_BMP_DROP_URL (BMP_START + 2)
#define RID_BMP_DROP_LINK (BMP_START + 3)
#define RID_BMP_DROP_COPY (BMP_START + 4)
#define RID_BMP_SELECT_CURRENT (BMP_START + 8)
#define RID_BMP_UNSELECT_CURRENT (BMP_START + 9)
#define IMG_CELL_BORDER (BMP_START + 10)
#define IMG_LINE_STYLE1 (BMP_START + 11)
#define IMG_LINE_STYLE2 (BMP_START + 12)
#define IMG_LINE_STYLE3 (BMP_START + 13)
#define IMG_LINE_STYLE4 (BMP_START + 14)
#define IMG_LINE_STYLE5 (BMP_START + 15)
#define IMG_LINE_STYLE6 (BMP_START + 16)
#define IMG_LINE_STYLE7 (BMP_START + 17)
#define IMG_LINE_STYLE8 (BMP_START + 18)
#define IMG_LINE_STYLE9 (BMP_START + 19)
#define IMG_ELEMENT_DEFAULT (BMP_START + 20)
#define IMG_ELEMENT_REPEAT (BMP_START + 21)
#define IMG_ELEMENT_ATTRIBUTE (BMP_START + 22)
#define RID_BMP_CELL_BORDER (BMP_START + 10)
#define RID_BMP_LINE_STYLE1 (BMP_START + 11)
#define RID_BMP_LINE_STYLE2 (BMP_START + 12)
#define RID_BMP_LINE_STYLE3 (BMP_START + 13)
#define RID_BMP_LINE_STYLE4 (BMP_START + 14)
#define RID_BMP_LINE_STYLE5 (BMP_START + 15)
#define RID_BMP_LINE_STYLE6 (BMP_START + 16)
#define RID_BMP_LINE_STYLE7 (BMP_START + 17)
#define RID_BMP_LINE_STYLE8 (BMP_START + 18)
#define RID_BMP_LINE_STYLE9 (BMP_START + 19)
#define RID_BMP_ELEMENT_DEFAULT (BMP_START + 20)
#define RID_BMP_ELEMENT_REPEAT (BMP_START + 21)
#define RID_BMP_ELEMENT_ATTRIBUTE (BMP_START + 22)
#define RID_BMP_LEVEL1 (BMP_START + 23)
#define RID_BMP_LEVEL2 (BMP_START + 24)
#define RID_BMP_LEVEL3 (BMP_START + 25)

View File

@ -1096,13 +1096,10 @@ void ScCheckListMenuWindow::packWindow()
float fScaleFactor = GetDPIScaleFactor();
Image aSingleSelect(ScResId(RID_IMG_SELECT_CURRENT));
BitmapEx aSingleSelectBmp(ScResId(RID_BMP_SELECT_CURRENT));
if (fScaleFactor > 1)
{
BitmapEx aBitmap = aSingleSelect.GetBitmapEx();
aBitmap.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast);
aSingleSelect = Image(aBitmap);
}
aSingleSelectBmp.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast);
Image aSingleSelect(aSingleSelectBmp);
getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT);
maBtnSelectSingle->SetPosSizePixel(aPos, aSize);
@ -1111,13 +1108,10 @@ void ScCheckListMenuWindow::packWindow()
maBtnSelectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
maBtnSelectSingle->Show();
Image aSingleUnselect(ScResId(RID_IMG_UNSELECT_CURRENT));
BitmapEx aSingleUnselectBmp(ScResId(RID_BMP_UNSELECT_CURRENT));
if (fScaleFactor > 1)
{
BitmapEx aBitmap = aSingleUnselect.GetBitmapEx();
aBitmap.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast);
aSingleUnselect = Image(aBitmap);
}
aSingleUnselectBmp.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast);
Image aSingleUnselect(aSingleUnselectBmp);
getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT);
maBtnUnselectSingle->SetPosSizePixel(aPos, aSize);

View File

@ -57,20 +57,14 @@ Resource RID_POPUP_FILTER
};
};
Image RID_IMG_SELECT_CURRENT
Bitmap RID_BMP_SELECT_CURRENT
{
ImageBitmap = Bitmap
{
File = "popup_select_current.png";
};
File = "popup_select_current.png";
};
Image RID_IMG_UNSELECT_CURRENT
Bitmap RID_BMP_UNSELECT_CURRENT
{
ImageBitmap = Bitmap
{
File = "popup_unselect_current.png";
};
File = "popup_unselect_current.png";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -396,16 +396,16 @@ void ScNavigatorDlg::UpdateButtons()
switch (nDropMode)
{
case SC_DROPMODE_URL:
nImageId = RID_IMG_DROP_URL;
nImageId = RID_BMP_DROP_URL;
break;
case SC_DROPMODE_LINK:
nImageId = RID_IMG_DROP_LINK;
nImageId = RID_BMP_DROP_LINK;
break;
case SC_DROPMODE_COPY:
nImageId = RID_IMG_DROP_COPY;
nImageId = RID_BMP_DROP_COPY;
break;
}
aTbxCmd->SetItemImage(nDragModeId, Image(ScResId(nImageId)));
aTbxCmd->SetItemImage(nDragModeId, Image(BitmapEx(ScResId(nImageId))));
}
ScNavigatorSettings::ScNavigatorSettings()

View File

@ -59,34 +59,34 @@ Bitmap RID_BMP_CONTENT_DRAWING
File = "nc08.png";
};
Image RID_IMG_DROP_URL
Bitmap RID_BMP_DROP_URL
{
ImageBitmap = Bitmap { File = "dropurl.png" ; };
File = "dropurl.png";
};
Image RID_IMG_DROP_LINK
Bitmap RID_BMP_DROP_LINK
{
ImageBitmap = Bitmap { File = "droplink.png" ; };
File = "droplink.png";
};
Image RID_IMG_DROP_COPY
Bitmap RID_BMP_DROP_COPY
{
ImageBitmap = Bitmap { File = "dropcopy.png" ; };
File = "dropcopy.png";
};
Image IMG_ELEMENT_DEFAULT
Bitmap RID_BMP_ELEMENT_DEFAULT
{
ImageBitmap = Bitmap { File = "xml_element.png" ; };
File = "xml_element.png";
};
Image IMG_ELEMENT_REPEAT
Bitmap RID_BMP_ELEMENT_REPEAT
{
ImageBitmap = Bitmap { File = "xml_element_repeat.png" ; };
File = "xml_element_repeat.png";
};
Image IMG_ELEMENT_ATTRIBUTE
Bitmap RID_BMP_ELEMENT_ATTRIBUTE
{
ImageBitmap = Bitmap { File = "xml_attribute.png" ; };
File = "xml_attribute.png";
};
// content description strings are also used in ScLinkTargetsObj

View File

@ -18,11 +18,10 @@
*/
#include "sc.hrc"
// -> RID_SCPAGE_AREAS
// TabPage: Tabelle
#define IMG_LEFTRIGHT (SC_DIALOGS_START + 43 + 23)
#define IMG_TOPDOWN (SC_DIALOGS_START + 43 + 24)
#define BMP_LEFTRIGHT (SC_DIALOGS_START + 43 + 23)
#define BMP_TOPDOWN (SC_DIALOGS_START + 43 + 24)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -18,13 +18,14 @@
*/
#include "pagedlg.hrc"
Image IMG_LEFTRIGHT
{
ImageBitmap = Bitmap { File = "lftrgt.png" ; };
};
Image IMG_TOPDOWN
{
ImageBitmap = Bitmap { File = "topdown.png" ; };
};
Bitmap BMP_LEFTRIGHT
{
File = "lftrgt.png";
};
Bitmap BMP_TOPDOWN
{
File = "topdown.png";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -117,7 +117,7 @@ ScTablePage::ScTablePage( vcl::Window* pParent, const SfxItemSet& rCoreAttrs ) :
void ScTablePage::ShowImage()
{
Image aImg = Image( ScResId( (m_pBtnLeftRight->IsChecked()) ? IMG_LEFTRIGHT : IMG_TOPDOWN ) );
Image aImg(BitmapEx(ScResId((m_pBtnLeftRight->IsChecked()) ? BMP_LEFTRIGHT : BMP_TOPDOWN)));
m_pBmpPageDir->SetImage( aImg );
m_pBmpPageDir->SetOutputSizePixel( aImg.GetSizePixel() );
}

View File

@ -58,16 +58,16 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
maBorderTLBRControl(SID_ATTR_BORDER_DIAG_TLBR, *pBindings, *this),
maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this),
maIMGCellBorder(ScResId(IMG_CELL_BORDER)),
maIMGLineStyle1(ScResId(IMG_LINE_STYLE1)),
maIMGLineStyle2(ScResId(IMG_LINE_STYLE2)),
maIMGLineStyle3(ScResId(IMG_LINE_STYLE3)),
maIMGLineStyle4(ScResId(IMG_LINE_STYLE4)),
maIMGLineStyle5(ScResId(IMG_LINE_STYLE5)),
maIMGLineStyle6(ScResId(IMG_LINE_STYLE6)),
maIMGLineStyle7(ScResId(IMG_LINE_STYLE7)),
maIMGLineStyle8(ScResId(IMG_LINE_STYLE8)),
maIMGLineStyle9(ScResId(IMG_LINE_STYLE9)),
maIMGCellBorder(BitmapEx(ScResId(RID_BMP_CELL_BORDER))),
maIMGLineStyle1(BitmapEx(ScResId(RID_BMP_LINE_STYLE1))),
maIMGLineStyle2(BitmapEx(ScResId(RID_BMP_LINE_STYLE2))),
maIMGLineStyle3(BitmapEx(ScResId(RID_BMP_LINE_STYLE3))),
maIMGLineStyle4(BitmapEx(ScResId(RID_BMP_LINE_STYLE4))),
maIMGLineStyle5(BitmapEx(ScResId(RID_BMP_LINE_STYLE5))),
maIMGLineStyle6(BitmapEx(ScResId(RID_BMP_LINE_STYLE6))),
maIMGLineStyle7(BitmapEx(ScResId(RID_BMP_LINE_STYLE7))),
maIMGLineStyle8(BitmapEx(ScResId(RID_BMP_LINE_STYLE8))),
maIMGLineStyle9(BitmapEx(ScResId(RID_BMP_LINE_STYLE9))),
mnIn(0),
mnOut(0),

View File

@ -20,45 +20,54 @@
#include "sc.hrc"
#include "helpids.h"
Image IMG_CELL_BORDER
Bitmap RID_BMP_CELL_BORDER
{
ImageBitmap = Bitmap{File = "sidebar/CellBorder.png";};
File = "sidebar/CellBorder.png";
};
Image IMG_LINE_STYLE1
Bitmap RID_BMP_LINE_STYLE1
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_005.png";};
File = "sidebar/CellBorderLineStyle_005.png";
};
Image IMG_LINE_STYLE2
Bitmap RID_BMP_LINE_STYLE2
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_250.png";};
File = "sidebar/CellBorderLineStyle_250.png";
};
Image IMG_LINE_STYLE3
Bitmap RID_BMP_LINE_STYLE3
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_400.png";};
File = "sidebar/CellBorderLineStyle_400.png";
};
Image IMG_LINE_STYLE4
Bitmap RID_BMP_LINE_STYLE4
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_500.png";};
File = "sidebar/CellBorderLineStyle_500.png";
};
Image IMG_LINE_STYLE5
Bitmap RID_BMP_LINE_STYLE5
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_110.png";};
File = "sidebar/CellBorderLineStyle_110.png";
};
Image IMG_LINE_STYLE6
Bitmap RID_BMP_LINE_STYLE6
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_260.png";};
File = "sidebar/CellBorderLineStyle_260.png";
};
Image IMG_LINE_STYLE7
Bitmap RID_BMP_LINE_STYLE7
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_450.png";};
File = "sidebar/CellBorderLineStyle_450.png";
};
Image IMG_LINE_STYLE8
Bitmap RID_BMP_LINE_STYLE8
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_505.png";};
File = "sidebar/CellBorderLineStyle_505.png";
};
Image IMG_LINE_STYLE9
Bitmap RID_BMP_LINE_STYLE9
{
ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750.png";};
File = "sidebar/CellBorderLineStyle_750.png";
};
// cell border style popup

View File

@ -90,9 +90,9 @@ ScXMLSourceDlg::ScXMLSourceDlg(
mpActiveEdit = mpRefEdit;
maXMLParam.maImgElementDefault = Image(ScResId(IMG_ELEMENT_DEFAULT));
maXMLParam.maImgElementRepeat = Image(ScResId(IMG_ELEMENT_REPEAT));
maXMLParam.maImgAttribute = Image(ScResId(IMG_ELEMENT_ATTRIBUTE));
maXMLParam.maImgElementDefault = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_DEFAULT)));
maXMLParam.maImgElementRepeat = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_REPEAT)));
maXMLParam.maImgAttribute = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_ATTRIBUTE)));
Link<Button*,void> aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl);
mpBtnSelectSource->SetClickHdl(aBtnHdl);