diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-18 11:06:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-18 11:49:17 +0100 |
commit | 41b8b8c5ede634774851b438a4c823962c14b611 (patch) | |
tree | 32f01359c625aefc0a2c73e7d2969b6fda98f49b /cui | |
parent | cc7712ba4c70c035cbf080c5cf2f2eb6f9fe3eb1 (diff) |
use Image(OUString) instead of Image(Bitmap(OUString))
which benefits LOOL since we can delay creating the image until
we know the dpi setting of the display we are going to write to.
Change-Id: I4c16fd221f7ec3693e37bacf3fdf7026a8c2e8bc
Reviewed-on: https://gerrit.libreoffice.org/66574
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/cuihyperdlg.cxx | 19 | ||||
-rw-r--r-- | cui/source/dialogs/hldocntp.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/hldoctp.cxx | 8 | ||||
-rw-r--r-- | cui/source/dialogs/hlmailtp.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 4 | ||||
-rw-r--r-- | cui/source/inc/border.hxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/align.cxx | 19 | ||||
-rw-r--r-- | cui/source/tabpages/border.cxx | 13 |
8 files changed, 19 insertions, 56 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 9612b8195bd6..26a6e4f027c4 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -89,33 +89,22 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings) { mbGrabFocus = true; // insert pages - std::vector<Image> imgVector; OUString aStrTitle; SvxIconChoiceCtrlEntry *pEntry; - imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLINETTP); - imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLMAILTP); - imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLDOCTP); - imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLDOCNTP); - for(Image &aImage : imgVector ) - { - BitmapEx aBitmap = aImage.GetBitmapEx(); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality); - aImage = Image(aBitmap); - } aStrTitle = CuiResId( RID_SVXSTR_HYPERDLG_HLINETTP ); - pEntry = AddTabPage ( HyperLinkPageType::Internet, aStrTitle, imgVector[0], SvxHyperlinkInternetTp::Create ); + pEntry = AddTabPage ( HyperLinkPageType::Internet, aStrTitle, Image(StockImage::Yes, RID_SVXBMP_HLINETTP), SvxHyperlinkInternetTp::Create ); pEntry->SetQuickHelpText( CuiResId( RID_SVXSTR_HYPERDLG_HLINETTP_HELP ) ); aStrTitle = CuiResId( RID_SVXSTR_HYPERDLG_HLMAILTP ); - pEntry = AddTabPage ( HyperLinkPageType::Mail, aStrTitle, imgVector[1], SvxHyperlinkMailTp::Create ); + pEntry = AddTabPage ( HyperLinkPageType::Mail, aStrTitle, Image(StockImage::Yes, RID_SVXBMP_HLMAILTP), SvxHyperlinkMailTp::Create ); pEntry->SetQuickHelpText( CuiResId( RID_SVXSTR_HYPERDLG_HLMAILTP_HELP ) ); if (!comphelper::LibreOfficeKit::isActive()) { aStrTitle = CuiResId( RID_SVXSTR_HYPERDLG_HLDOCTP ); - pEntry = AddTabPage ( HyperLinkPageType::Document, aStrTitle, imgVector[2], SvxHyperlinkDocTp::Create ); + pEntry = AddTabPage ( HyperLinkPageType::Document, aStrTitle, Image(StockImage::Yes, RID_SVXBMP_HLDOCTP), SvxHyperlinkDocTp::Create ); pEntry->SetQuickHelpText( CuiResId( RID_SVXSTR_HYPERDLG_HLDOCTP_HELP ) ); aStrTitle = CuiResId( RID_SVXSTR_HYPERDLG_HLDOCNTP ); - pEntry = AddTabPage ( HyperLinkPageType::NewDocument, aStrTitle, imgVector[3], SvxHyperlinkNewDocTp::Create ); + pEntry = AddTabPage ( HyperLinkPageType::NewDocument, aStrTitle, Image(StockImage::Yes, RID_SVXBMP_HLDOCNTP), SvxHyperlinkNewDocTp::Create ); pEntry->SetQuickHelpText( CuiResId( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) ); } diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 96a2fcac3ed8..4246bfec636f 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -111,9 +111,7 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia get(m_pCbbPath, "path"); m_pCbbPath->SetSmartProtocol(INetProtocol::File); get(m_pBtCreate, "create"); - BitmapEx aBitmap(RID_SVXBMP_NEWDOC); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); - m_pBtCreate->SetModeImage(Image(aBitmap)); + m_pBtCreate->SetModeImage(Image(RID_SVXBMP_NEWDOC)); get(m_pLbDocTypes, "types"); m_pLbDocTypes->set_height_request(m_pLbDocTypes->GetTextHeight() * 5); diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index 9c3033b693c7..968c420211c2 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -42,15 +42,11 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p get(m_pCbbPath, "path"); m_pCbbPath->SetSmartProtocol(INetProtocol::File); get(m_pBtFileopen, "fileopen"); - BitmapEx aBitmap(RID_SVXBMP_FILEOPEN); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality); - m_pBtFileopen->SetModeImage(Image(aBitmap)); + m_pBtFileopen->SetModeImage(Image(RID_SVXBMP_FILEOPEN)); get(m_pEdTarget, "target"); get(m_pFtFullURL, "url"); get(m_pBtBrowse, "browse"); - aBitmap = BitmapEx(RID_SVXBMP_TARGET); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); - m_pBtBrowse->SetModeImage(Image(aBitmap)); + m_pBtBrowse->SetModeImage(Image(RID_SVXBMP_TARGET)); // Disable display of bitmap names. m_pBtBrowse->EnableTextDisplay (false); diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx index f3f9cbc9ed39..b56f34ff41c9 100644 --- a/cui/source/dialogs/hlmailtp.cxx +++ b/cui/source/dialogs/hlmailtp.cxx @@ -42,9 +42,7 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* get(m_pCbbReceiver, "receiver"); m_pCbbReceiver->SetSmartProtocol(INetProtocol::Mailto); get(m_pBtAdrBook, "adressbook"); - BitmapEx aBitmap(RID_SVXBMP_ADRESSBOOK); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); - m_pBtAdrBook->SetModeImage(Image(aBitmap)); + m_pBtAdrBook->SetModeImage(Image(RID_SVXBMP_ADRESSBOOK)); get(m_pFtSubject, "subject_label"); get(m_pEdSubject, "subject"); diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 38402c8af924..0becb6f69590 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -176,9 +176,7 @@ void SvxHyperlinkTabPageBase::InitStdControls () get(mpEdIndication, "indication"); get(mpEdText, "name"); get(mpBtScript, "script"); - BitmapEx aBitmap(RID_SVXBMP_SCRIPT); - aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); - mpBtScript->SetModeImage(Image(aBitmap)); + mpBtScript->SetModeImage(Image(RID_SVXBMP_SCRIPT)); mpBtScript->SetClickHdl ( LINK ( this, SvxHyperlinkTabPageBase, ClickScriptHdl_Impl ) ); mpBtScript->EnableTextDisplay (false); diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 009048d738fb..a57db4dc58f0 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -102,8 +102,8 @@ protected: private: SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); - std::vector<BitmapEx> m_aShadowImgVec; - std::vector<BitmapEx> m_aBorderImgVec; + std::vector<Image> m_aShadowImgVec; + std::vector<Image> m_aBorderImgVec; long nMinValue; ///< minimum distance SwBorderModes nSWMode; ///< table, textframe, paragraph diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 57e23b0bba46..0b230fc4cd05 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -596,24 +596,17 @@ void AlignmentTabPage::InitVsRefEgde() // remember selection - is deleted in call to ValueSet::Clear() sal_uInt16 nSel = m_aVsRefEdge.GetSelectedItemId(); - BitmapEx aBottomLock(RID_SVXBMP_BOTTOMLOCK); - BitmapEx aTopLock(RID_SVXBMP_TOPLOCK); - BitmapEx aCellLock(RID_SVXBMP_CELLLOCK); - - if( GetDPIScaleFactor() > 1 ) - { - aBottomLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); - aTopLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); - aCellLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); - } + Image aBottomLock(RID_SVXBMP_BOTTOMLOCK); + Image aTopLock(RID_SVXBMP_TOPLOCK); + Image aCellLock(RID_SVXBMP_CELLLOCK); m_aVsRefEdge.Clear(); m_aVsRefEdge.SetStyle(m_aVsRefEdge.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER); m_aVsRefEdge.SetColCount(3); - m_aVsRefEdge.InsertItem(IID_BOTTOMLOCK, Image(aBottomLock), m_xFtBotLock->get_label()); - m_aVsRefEdge.InsertItem(IID_TOPLOCK, Image(aTopLock), m_xFtTopLock->get_label()); - m_aVsRefEdge.InsertItem(IID_CELLLOCK, Image(aCellLock), m_xFtCelLock->get_label()); + m_aVsRefEdge.InsertItem(IID_BOTTOMLOCK, aBottomLock, m_xFtBotLock->get_label()); + m_aVsRefEdge.InsertItem(IID_TOPLOCK, aTopLock, m_xFtTopLock->get_label()); + m_aVsRefEdge.InsertItem(IID_CELLLOCK, aCellLock, m_xFtCelLock->get_label()); m_aVsRefEdge.SetOptimalSize(); m_aVsRefEdge.SelectItem( nSel ); diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 749505c1fd0f..aa48782017c9 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -309,15 +309,6 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor m_aShadowImgVec.emplace_back(pnShadowImgIds[i]); assert(m_aShadowImgVec.size() == SVX_BORDER_SHADOW_COUNT); - if ( GetDPIScaleFactor() > 1 ) - { - for (size_t i = 0; i < m_aBorderImgVec.size(); ++i) - m_aBorderImgVec[i].Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); - - for (size_t i = 0; i < m_aShadowImgVec.size(); ++i) - m_aShadowImgVec[i].Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); - } - // this page needs ExchangeSupport SetExchangeSupport(); @@ -1226,7 +1217,7 @@ void SvxBorderTabPage::FillPresetVS() for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_PRESET_COUNT; ++nVSIdx ) { m_xWndPresets->InsertItem( nVSIdx ); - m_xWndPresets->SetItemImage(nVSIdx, Image(m_aBorderImgVec[GetPresetImageId(nVSIdx) - 1])); + m_xWndPresets->SetItemImage(nVSIdx, m_aBorderImgVec[GetPresetImageId(nVSIdx) - 1]); m_xWndPresets->SetItemText( nVSIdx, CuiResId( GetPresetStringId( nVSIdx ) ) ); } @@ -1250,7 +1241,7 @@ void SvxBorderTabPage::FillShadowVS() for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_SHADOW_COUNT; ++nVSIdx ) { m_xWndShadows->InsertItem( nVSIdx ); - m_xWndShadows->SetItemImage(nVSIdx, Image(m_aShadowImgVec[nVSIdx-1])); + m_xWndShadows->SetItemImage(nVSIdx, m_aShadowImgVec[nVSIdx-1]); m_xWndShadows->SetItemText( nVSIdx, CuiResId( pnStrIds[ nVSIdx - 1 ] ) ); } |