[Libreoffice-commits] core.git: cui/source

Caolán McNamara caolanm at redhat.com
Wed Dec 21 12:41:41 UTC 2016


 cui/source/inc/cuires.hrc     |    3 +++
 cui/source/tabpages/align.cxx |   28 ++++++++++++++--------------
 cui/source/tabpages/align.hrc |   32 --------------------------------
 cui/source/tabpages/align.src |   25 ++++++++++++-------------
 4 files changed, 29 insertions(+), 59 deletions(-)

New commits:
commit 63fe7f65d2a606da6b34d7809c159985da0bfc65
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 21 12:35:16 2016 +0000

    unroll IL_LOCK_BMPS ImageList
    
    Change-Id: I5a9c80d5c23bfa22fd6e237b7a2524c29992c9b9

diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 33f5ea3..4f2ea36 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -176,6 +176,9 @@
 #define RID_SVXBMP_HLMAILTP                 (RID_SVX_START + 557)
 #define RID_SVXBMP_HLDOCTP                  (RID_SVX_START + 558)
 #define RID_SVXBMP_HLDOCNTP                 (RID_SVX_START + 559)
+#define RID_SVXBMP_BOTTOMLOCK               (RID_SVX_START + 560)
+#define RID_SVXBMP_TOPLOCK                  (RID_SVX_START + 561)
+#define RID_SVXBMP_CELLLOCK                 (RID_SVX_START + 562)
 #define RID_SVXPAGE_HYPERLINK_INTERNET      (RID_SVX_START + 228)
 #define RID_SVXPAGE_HYPERLINK_MAIL          (RID_SVX_START + 229)
 #define RID_SVXPAGE_HYPERLINK_DOCUMENT      (RID_SVX_START + 230)
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index aa6ea21..b657329 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -22,7 +22,6 @@
 #include <editeng/svxenum.hxx>
 #include <svx/dialogs.hrc>
 #include <cuires.hrc>
-#include "align.hrc"
 #include <svx/rotmodit.hxx>
 
 #include <svx/algitem.hxx>
@@ -40,6 +39,10 @@
 #include <sfx2/request.hxx>
 #include <vcl/settings.hxx>
 
+#define IID_BOTTOMLOCK 1
+#define IID_TOPLOCK    2
+#define IID_CELLLOCK   3
+
 namespace svx {
 
 // item connections ===========================================================
@@ -337,29 +340,26 @@ void AlignmentTabPage::InitVsRefEgde()
     // remember selection - is deleted in call to ValueSet::Clear()
     sal_uInt16 nSel = m_pVsRefEdge->GetSelectItemId();
 
-    ResId aResId( IL_LOCK_BMPS, CUI_MGR() );
-    ImageList aImageList( aResId );
+    BitmapEx aBottomLock(ResId(RID_SVXBMP_BOTTOMLOCK, CUI_MGR()));
+    BitmapEx aTopLock(ResId(RID_SVXBMP_TOPLOCK, CUI_MGR()));
+    BitmapEx aCellLock(ResId(RID_SVXBMP_CELLLOCK, CUI_MGR()));
 
     if( GetDPIScaleFactor() > 1 )
     {
-        for (short i = 0; i < aImageList.GetImageCount(); i++)
-        {
-            OUString rImageName = aImageList.GetImageName(i);
-            BitmapEx b = aImageList.GetImage(rImageName).GetBitmapEx();
-            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
-            aImageList.ReplaceImage(rImageName, Image(b));
-        }
+        aBottomLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
+        aTopLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
+        aCellLock.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
     }
 
-    Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() );
+    Size aItemSize(aBottomLock.GetSizePixel());
 
     m_pVsRefEdge->Clear();
     m_pVsRefEdge->SetStyle( m_pVsRefEdge->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
 
     m_pVsRefEdge->SetColCount( 3 );
-    m_pVsRefEdge->InsertItem( IID_BOTTOMLOCK, aImageList.GetImage( IID_BOTTOMLOCK ),  m_pFtBotLock->GetText() );
-    m_pVsRefEdge->InsertItem( IID_TOPLOCK,    aImageList.GetImage( IID_TOPLOCK ),     m_pFtTopLock->GetText() );
-    m_pVsRefEdge->InsertItem( IID_CELLLOCK,   aImageList.GetImage( IID_CELLLOCK ),    m_pFtCelLock->GetText() );
+    m_pVsRefEdge->InsertItem(IID_BOTTOMLOCK, Image(aBottomLock),  m_pFtBotLock->GetText());
+    m_pVsRefEdge->InsertItem(IID_TOPLOCK,    Image(aTopLock),     m_pFtTopLock->GetText());
+    m_pVsRefEdge->InsertItem(IID_CELLLOCK,   Image(aCellLock),    m_pFtCelLock->GetText());
 
     m_pVsRefEdge->SetSizePixel( m_pVsRefEdge->CalcWindowSizePixel( aItemSize ) );
 
diff --git a/cui/source/tabpages/align.hrc b/cui/source/tabpages/align.hrc
deleted file mode 100644
index 44e3657..0000000
--- a/cui/source/tabpages/align.hrc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_CUI_SOURCE_TABPAGES_ALIGN_HRC
-#define INCLUDED_CUI_SOURCE_TABPAGES_ALIGN_HRC
-
-// image list for ValueSets:
-#define IL_LOCK_BMPS                1100
-#define IID_BOTTOMLOCK              1
-#define IID_TOPLOCK                 2
-#define IID_CELLLOCK                3
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/align.src b/cui/source/tabpages/align.src
index 7db8fc8..cfb84df 100644
--- a/cui/source/tabpages/align.src
+++ b/cui/source/tabpages/align.src
@@ -17,20 +17,19 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "align.hrc"
+Bitmap RID_SVXBMP_BOTTOMLOCK
+{
+    File = "lo01.png";
+};
 
-#define IL_LOCK_MCOL Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
+Bitmap RID_SVXBMP_TOPLOCK
+{
+    File = "lo02.png";
+};
 
-ImageList IL_LOCK_BMPS
-    {
-        Prefix = "lo";
-        IdList =
-        {
-            IID_BOTTOMLOCK ;
-            IID_TOPLOCK ;
-            IID_CELLLOCK ;
-        };
-        IdCount = { 3 ; };
-    };
+Bitmap RID_SVXBMP_CELLLOCK
+{
+    File = "lo03.png";
+};
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list