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

Caolán McNamara caolanm at redhat.com
Wed Jan 18 21:12:33 UTC 2017


 sw/source/ui/shells/shells.src            |   29 +++++++++-------
 sw/source/ui/utlui/utlui.src              |   53 ++++++++++--------------------
 sw/source/uibase/docvw/PageBreakWin.cxx   |    6 +--
 sw/source/uibase/inc/shells.hrc           |   12 +++---
 sw/source/uibase/inc/utlui.hrc            |   14 +++----
 sw/source/uibase/lingu/olmenu.cxx         |    2 -
 sw/source/uibase/lingu/olmenu.hrc         |    2 -
 sw/source/uibase/lingu/olmenu.src         |    5 +-
 sw/source/uibase/misc/redlndlg.cxx        |   10 ++---
 sw/source/uibase/utlui/viewlayoutctrl.cxx |   12 +++---
 10 files changed, 67 insertions(+), 78 deletions(-)

New commits:
commit 783a107ee705528275e0e3e25931cd4fe8a98258
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 18 21:11:04 2017 +0000

    sw: load BitmapEx resources instead of Image ones
    
    Change-Id: I77b5a892478d048decc2f5a018dbaf5a11b0194d

diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src
index d8ac163..7814bdd 100644
--- a/sw/source/ui/shells/shells.src
+++ b/sw/source/ui/shells/shells.src
@@ -71,33 +71,38 @@ String STR_REDLINE_AUTOFMT
         Text [ en-US ] = "AutoCorrect";
 };
 
-Image IMG_REDLINE_INSERTED
+Bitmap BMP_REDLINE_INSERTED
 {
-    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+    File = "redline_inserted.png";
 };
-Image IMG_REDLINE_DELETED
+
+Bitmap BMP_REDLINE_DELETED
 {
-    ImageBitmap = Bitmap{File = "redline_deleted.png";};
+    File = "redline_deleted.png";
 };
-Image IMG_REDLINE_FORMATED
+
+Bitmap BMP_REDLINE_FORMATED
 {
     // FIXME
-    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+    File = "redline_inserted.png";
 };
-Image IMG_REDLINE_TABLECHG
+
+Bitmap BMP_REDLINE_TABLECHG
 {
     // FIXME
-    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+    File = "redline_inserted.png";
 };
-Image IMG_REDLINE_FMTCOLLSET
+
+Bitmap BMP_REDLINE_FMTCOLLSET
 {
     // FIXME
-    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+    File = "redline_inserted.png";
 };
-Image IMG_REDLINE_AUTOFMT
+
+Bitmap BMP_REDLINE_AUTOFMT
 {
     // FIXME
-    ImageBitmap = Bitmap{File = "redline_inserted.png";};
+    File = "redline_inserted.png";
 };
 
 String STR_REDLINE_FORMATED
diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src
index d471dc1..61f4653 100644
--- a/sw/source/ui/utlui/utlui.src
+++ b/sw/source/ui/utlui/utlui.src
@@ -349,56 +349,39 @@ Bitmap RID_BMP_DBQUERY
     File = "sx03.png";
 };
 
-Image IMG_VIEWLAYOUT_AUTOMATIC
+Bitmap RID_BMP_VIEWLAYOUT_AUTOMATIC
 {
-    ImageBitmap = Bitmap
-    {
-        File = "twopages_10x24.png" ;
-    };
+    File = "twopages_10x24.png" ;
 };
-Image IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE
+
+Bitmap RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE
 {
-    ImageBitmap = Bitmap
-    {
-        File = "twopages_a_10x24.png" ;
-    };
+    File = "twopages_a_10x24.png" ;
 };
 
-Image IMG_VIEWLAYOUT_BOOKMODE
+Bitmap RID_BMP_VIEWLAYOUT_BOOKMODE
 {
-    ImageBitmap = Bitmap
-    {
-        File = "doublepage_10x22.png" ;
-    };
+    File = "doublepage_10x22.png" ;
 };
-Image IMG_VIEWLAYOUT_BOOKMODE_ACTIVE
+
+Bitmap RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE
 {
-    ImageBitmap = Bitmap
-    {
-        File = "doublepage_a_10x22.png" ;
-    };
+    File = "doublepage_a_10x22.png" ;
 };
 
-Image IMG_VIEWLAYOUT_SINGLECOLUMN
+Bitmap RID_BMP_VIEWLAYOUT_SINGLECOLUMN
 {
-    ImageBitmap = Bitmap
-    {
-        File = "emptypage_10x14.png" ;
-    };
+    File = "emptypage_10x14.png" ;
 };
-Image IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE
+
+Bitmap RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE
 {
-    ImageBitmap = Bitmap
-    {
-        File = "emptypage_a_10x14.png" ;
-    };
+    File = "emptypage_a_10x14.png" ;
 };
-Image IMG_PAGE_BREAK
+
+Bitmap RID_BMP_PAGE_BREAK
 {
-    ImageBitmap = Bitmap
-    {
-        File = "page_break.png" ;
-    };
+    File = "page_break.png" ;
 };
 
 String STR_HYPERCTRL_SEL
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 03fcc6b..b4056c2 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -170,12 +170,12 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
                                         aPolygon, aColor));
 
     // Create the primitive for the image
-    Image aImg(SW_RES(IMG_PAGE_BREAK));
+    BitmapEx aBmpEx(SW_RES(RID_BMP_PAGE_BREAK));
     double nImgOfstX = 3.0;
     if (bRtl)
-        nImgOfstX = aRect.Right() - aImg.GetSizePixel().Width() - 3.0;
+        nImgOfstX = aRect.Right() - aBmpEx.GetSizePixel().Width() - 3.0;
     aSeq[2].set(new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D(
-                                        aImg.GetBitmapEx(), B2DPoint(nImgOfstX, 1.0)));
+                                        aBmpEx, B2DPoint(nImgOfstX, 1.0)));
 
     double nTop = double(aRect.getHeight()) / 2.0;
     double nBottom = nTop + 4.0;
diff --git a/sw/source/uibase/inc/shells.hrc b/sw/source/uibase/inc/shells.hrc
index 2680f14..ed67f6e 100644
--- a/sw/source/uibase/inc/shells.hrc
+++ b/sw/source/uibase/inc/shells.hrc
@@ -45,12 +45,12 @@
 #define RID_OLE_TOOLBOX            (RC_SHELLS_BEGIN +  22)
 #define RID_TOOLS_TOOLBOX          (RC_SHELLS_BEGIN +  23)
 
-#define IMG_REDLINE_INSERTED       (RC_SHELLS_BEGIN + 24)
-#define IMG_REDLINE_DELETED        (RC_SHELLS_BEGIN + 25)
-#define IMG_REDLINE_FORMATED       (RC_SHELLS_BEGIN + 26)
-#define IMG_REDLINE_TABLECHG       (RC_SHELLS_BEGIN + 27)
-#define IMG_REDLINE_FMTCOLLSET     (RC_SHELLS_BEGIN + 28)
-#define IMG_REDLINE_AUTOFMT        (RC_SHELLS_BEGIN + 29)
+#define BMP_REDLINE_INSERTED       (RC_SHELLS_BEGIN + 24)
+#define BMP_REDLINE_DELETED        (RC_SHELLS_BEGIN + 25)
+#define BMP_REDLINE_FORMATED       (RC_SHELLS_BEGIN + 26)
+#define BMP_REDLINE_TABLECHG       (RC_SHELLS_BEGIN + 27)
+#define BMP_REDLINE_FMTCOLLSET     (RC_SHELLS_BEGIN + 28)
+#define BMP_REDLINE_AUTOFMT        (RC_SHELLS_BEGIN + 29)
 
 #define RID_BEZIER_TOOLBOX         (RC_SHELLS_BEGIN +  33)
 
diff --git a/sw/source/uibase/inc/utlui.hrc b/sw/source/uibase/inc/utlui.hrc
index 9a0b7c7..1711108 100644
--- a/sw/source/uibase/inc/utlui.hrc
+++ b/sw/source/uibase/inc/utlui.hrc
@@ -145,13 +145,13 @@
 
 #define RES_FRMEX_MENU                  (STR_AUTH_FIELD_END + 1)
 
-#define IMG_VIEWLAYOUT_AUTOMATIC                 (RC_UTLUI_BEGIN + 12)
-#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE          (RC_UTLUI_BEGIN + 13)
-#define IMG_VIEWLAYOUT_BOOKMODE                  (RC_UTLUI_BEGIN + 14)
-#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE           (RC_UTLUI_BEGIN + 15)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN              (RC_UTLUI_BEGIN + 16)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE       (RC_UTLUI_BEGIN + 17)
-#define IMG_PAGE_BREAK                           (RC_UTLUI_BEGIN + 18)
+#define RID_BMP_VIEWLAYOUT_AUTOMATIC             (RC_UTLUI_BEGIN + 12)
+#define RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE      (RC_UTLUI_BEGIN + 13)
+#define RID_BMP_VIEWLAYOUT_BOOKMODE              (RC_UTLUI_BEGIN + 14)
+#define RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE       (RC_UTLUI_BEGIN + 15)
+#define RID_BMP_VIEWLAYOUT_SINGLECOLUMN          (RC_UTLUI_BEGIN + 16)
+#define RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE   (RC_UTLUI_BEGIN + 17)
+#define RID_BMP_PAGE_BREAK                       (RC_UTLUI_BEGIN + 18)
 #define RID_BMP_NAVI_OUTLINE                     (RC_UTLUI_BEGIN + 19)
 #define RID_BMP_NAVI_TABLE                       (RC_UTLUI_BEGIN + 20)
 #define RID_BMP_NAVI_FRAME                       (RC_UTLUI_BEGIN + 21)
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index a5fe2b6..579aad4 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -467,7 +467,7 @@ SwSpellPopup::SwSpellPopup(
     InsertSeparator(OString(), nPos++);
     InsertItem(MN_SHORT_COMMENT, aMessageText, MenuItemBits::NOSELECT, OString(), nPos++);
     if (bUseImagesInMenus)
-        SetItemImage(MN_SHORT_COMMENT, Image(SW_RES(IMG_INFO_16)));
+        SetItemImage(MN_SHORT_COMMENT, Image(BitmapEx(SW_RES(BMP_INFO_16))));
 
     // Add an item to show detailed infos if the FullCommentURL property is defined
     beans::PropertyValues  aProperties = rResult.aErrors[ nErrorInResult ].aProperties;
diff --git a/sw/source/uibase/lingu/olmenu.hrc b/sw/source/uibase/lingu/olmenu.hrc
index 5f08a7d..a0cd367 100644
--- a/sw/source/uibase/lingu/olmenu.hrc
+++ b/sw/source/uibase/lingu/olmenu.hrc
@@ -33,7 +33,7 @@
 #define STR_RESET_TO_DEFAULT_LANGUAGE   (RC_LINGU_BEGIN + 9)
 #define STR_EXPLANATION_LINK            (RC_LINGU_BEGIN + 10)
 
-#define IMG_INFO_16                     (RC_LINGU_BEGIN + 100)
+#define BMP_INFO_16                     (RC_LINGU_BEGIN + 100)
 
 //! Don't change these values. You may break context menu modifying extensions!
 #define MN_SPELLING_DLG                 200
diff --git a/sw/source/uibase/lingu/olmenu.src b/sw/source/uibase/lingu/olmenu.src
index 7dc4175..53ec2b4 100644
--- a/sw/source/uibase/lingu/olmenu.src
+++ b/sw/source/uibase/lingu/olmenu.src
@@ -148,9 +148,10 @@ String STR_EXPLANATION_LINK
 {
     Text [ en-US ] = "Explanations..." ;
 };
-Image IMG_INFO_16
+
+Bitmap BMP_INFO_16
 {
-    ImageBitmap = Bitmap { File = "info_16.png" ; };
+    File = "info_16.png";
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 6263e25..bc5c1c6 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -160,11 +160,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
     m_bOnlyFormatedRedlines( false ),
     m_bRedlnAutoFormat   (bAutoFormat),
     m_bInhibitActivate( false ),
-    m_aInserted       (SW_RES(IMG_REDLINE_INSERTED)),
-    m_aDeleted        (SW_RES(IMG_REDLINE_DELETED)),
-    m_aFormated       (SW_RES(IMG_REDLINE_FORMATED)),
-    m_aTableChgd      (SW_RES(IMG_REDLINE_TABLECHG)),
-    m_aFormatCollSet  (SW_RES(IMG_REDLINE_FMTCOLLSET))
+    m_aInserted       (BitmapEx(SW_RES(BMP_REDLINE_INSERTED))),
+    m_aDeleted        (BitmapEx(SW_RES(BMP_REDLINE_DELETED))),
+    m_aFormated       (BitmapEx(SW_RES(BMP_REDLINE_FORMATED))),
+    m_aTableChgd      (BitmapEx(SW_RES(BMP_REDLINE_TABLECHG))),
+    m_aFormatCollSet  (BitmapEx(SW_RES(BMP_REDLINE_FMTCOLLSET)))
 
 {
     m_aTabPagesCTRL->SetHelpId(HID_REDLINE_CTRL);
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index 6f0b5be..89be94c 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -45,12 +45,12 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
 {
     mpImpl->mnState = 1;
 
-    mpImpl->maImageSingleColumn         = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) );
-    mpImpl->maImageSingleColumn_Active  = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) );
-    mpImpl->maImageAutomatic            = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) );
-    mpImpl->maImageAutomatic_Active     = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) );
-    mpImpl->maImageBookMode             = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE) );
-    mpImpl->maImageBookMode_Active      = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) );
+    mpImpl->maImageSingleColumn         = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_SINGLECOLUMN)));
+    mpImpl->maImageSingleColumn_Active  = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE)));
+    mpImpl->maImageAutomatic            = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_AUTOMATIC)));
+    mpImpl->maImageAutomatic_Active     = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE)));
+    mpImpl->maImageBookMode             = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_BOOKMODE)));
+    mpImpl->maImageBookMode_Active      = Image(BitmapEx(SW_RES(RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE)));
 }
 
 SwViewLayoutControl::~SwViewLayoutControl()


More information about the Libreoffice-commits mailing list