From fcf9c22e00db0107391775f51fac53555711b951 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 27 Apr 2017 10:00:37 +0100 Subject: remove wizards bitmaps from .src files Change-Id: I4e334ac88e1e060bc07af9b174b9b8fb1401fc80 --- Repository.mk | 1 - postprocess/CustomTarget_images.mk | 1 + scp2/source/ooo/file_resource_ooo.scp | 2 - wizards/AllLangResTarget_wzi.mk | 34 ------------- wizards/Module_wizards.mk | 1 - .../sun/star/wizards/form/UIControlArranger.java | 26 ++++------ .../sun/star/wizards/report/ReportLayouter.java | 8 +-- wizards/com/sun/star/wizards/ui/ButtonList.java | 25 +++------ wizards/com/sun/star/wizards/ui/ImageList.py | 19 ------- wizards/com/sun/star/wizards/ui/PeerConfig.java | 26 ++-------- wizards/com/sun/star/wizards/ui/PeerConfig.py | 5 +- wizards/com/sun/star/wizards/ui/UIConsts.java | 7 +-- wizards/com/sun/star/wizards/ui/UIConsts.py | 9 +--- wizards/com/sun/star/wizards/ui/UnoDialog.java | 5 -- wizards/com/sun/star/wizards/ui/UnoDialog.py | 3 -- wizards/source/imagelists/imagelists.ilst | 7 +++ wizards/source/imagelists/imagelists.src | 59 ---------------------- 17 files changed, 35 insertions(+), 203 deletions(-) delete mode 100644 wizards/AllLangResTarget_wzi.mk create mode 100644 wizards/source/imagelists/imagelists.ilst delete mode 100644 wizards/source/imagelists/imagelists.src diff --git a/Repository.mk b/Repository.mk index c80ee8d75828..fb935a33558a 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1103,7 +1103,6 @@ $(eval $(call gb_Helper_register_resources,\ uui \ vcl \ writerperfect \ - wzi \ $(if $(ENABLE_NSS),xmlsec) \ xsltdlg \ )) diff --git a/postprocess/CustomTarget_images.mk b/postprocess/CustomTarget_images.mk index a6a8b683a25f..3da3cee1a4e8 100644 --- a/postprocess/CustomTarget_images.mk +++ b/postprocess/CustomTarget_images.mk @@ -28,6 +28,7 @@ $(packimages_DIR)/%.zip : \ $(packimages_DIR)/sorted.lst \ $(packimages_DIR)/commandimagelist.ilst \ $(packimages_DIR)/sourceimagelist.ilst \ + $(SRCDIR)/wizards/source/imagelists/imagelists.ilst \ $(call gb_Helper_optional,HELP,$(helpimages_DIR)/helpimg.ilst) \ $(call gb_Helper_optional,HELP,$(helpimages_DIR)/screenshotimg.ilst) \ $(call gb_Helper_get_imagelists) diff --git a/scp2/source/ooo/file_resource_ooo.scp b/scp2/source/ooo/file_resource_ooo.scp index c3884cbe1260..1ccf56babe5a 100644 --- a/scp2/source/ooo/file_resource_ooo.scp +++ b/scp2/source/ooo/file_resource_ooo.scp @@ -93,8 +93,6 @@ STD_RES_FILE( gid_File_Res_Vcl, vcl ) STD_RES_FILE( gid_File_Res_Writerperfect, writerperfect ) -STD_RES_FILE( gid_File_Res_Wzi, wzi ) - STD_RES_FILE( gid_File_Res_Xsltdlg, xsltdlg ) STD_RES_FILE( gid_File_Res_AVMedia, avmedia ) diff --git a/wizards/AllLangResTarget_wzi.mk b/wizards/AllLangResTarget_wzi.mk deleted file mode 100644 index ebb3e4b1c7eb..000000000000 --- a/wizards/AllLangResTarget_wzi.mk +++ /dev/null @@ -1,34 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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 . -# - -$(eval $(call gb_AllLangResTarget_AllLangResTarget,wzi)) - -$(eval $(call gb_AllLangResTarget_set_reslocation,wzi,wizards)) - -$(eval $(call gb_AllLangResTarget_add_srs,wzi,\ - wzi/res \ -)) - -$(eval $(call gb_SrsTarget_SrsTarget,wzi/res)) - -$(eval $(call gb_SrsTarget_add_nonlocalizable_files,wzi/res,\ - wizards/source/imagelists/imagelists.src \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/wizards/Module_wizards.mk b/wizards/Module_wizards.mk index e3beb17d67ec..d29f83b47c0b 100644 --- a/wizards/Module_wizards.mk +++ b/wizards/Module_wizards.mk @@ -44,7 +44,6 @@ $(eval $(call gb_Module_add_l10n_targets,wizards,\ AllLangResTarget_eur \ AllLangResTarget_imp \ AllLangResTarget_tpl \ - AllLangResTarget_wzi \ )) ifeq ($(ENABLE_JAVA),TRUE) diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index c5185306705a..a6b4b77f3a41 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -24,6 +24,7 @@ import com.sun.star.awt.XItemListener; import com.sun.star.awt.XRadioButton; import com.sun.star.lang.EventObject; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.IRenderer; import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.document.Control; import com.sun.star.wizards.ui.ButtonList; @@ -107,15 +108,16 @@ public class UIControlArranger HelpTexts[3] = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 39); // In Blocks - Labels Above" DefaultListModel imageModel = new DefaultListModel(); - for (int i = 0; i < HelpTexts.length; i++) - { - imageModel.addElement(Integer.valueOf(i)); - } - String sMainArrangementHeader = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 41); // "Arrangement of the main form" - m_aArrangeList[0] = new ArrangeButtonList(0, imageModel, sMainArrangementHeader); + imageModel.addElement("private:graphicrepository/wizards/res/formarrangelistside_42.png"); + imageModel.addElement("private:graphicrepository/wizards/res/formarrangelisttop_42.png"); + imageModel.addElement("private:graphicrepository/wizards/res/formarrangetable_42.png"); + imageModel.addElement("private:graphicrepository/wizards/res/formarrangefree_42.png"); + + String sMainArrangementHeader = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 41); // "Arrangement of the main form" + m_aArrangeList[0] = new ArrangeButtonList(0, imageModel, sMainArrangementHeader); - String sSubArrangementHeader = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 42); // "Arrangement of the sub form" - m_aArrangeList[1] = new ArrangeButtonList(1, imageModel, sSubArrangementHeader); + String sSubArrangementHeader = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 42); // "Arrangement of the sub form" + m_aArrangeList[1] = new ArrangeButtonList(1, imageModel, sSubArrangementHeader); enableAlignControlGroup(false); } @@ -124,14 +126,8 @@ public class UIControlArranger return m_aArrangeList[_formindex].m_aButtonList.getSelected() + 1; } - private class LayoutRenderer implements ButtonList.IImageRenderer + private class LayoutRenderer implements IRenderer { - public Object getImageUrl(Object listitem) - { - int ResId = UIConsts.RID_IMG_FORM + (2 * ((Integer) listitem).intValue()); - return Integer.valueOf(ResId); - } - public String render(Object listItem) { if (listItem == null) diff --git a/wizards/com/sun/star/wizards/report/ReportLayouter.java b/wizards/com/sun/star/wizards/report/ReportLayouter.java index 08baeab70a26..ad11aa8125be 100644 --- a/wizards/com/sun/star/wizards/report/ReportLayouter.java +++ b/wizards/com/sun/star/wizards/report/ReportLayouter.java @@ -191,11 +191,11 @@ public class ReportLayouter }); if (m_nLandscapeState == 1) { - CurUnoDialog.getPeerConfiguration().setImageUrl(aOrientationImage, 1002); + CurUnoDialog.getPeerConfiguration().setImageUrl(aOrientationImage, "private:graphicrepository/wizards/res/landscape_32.png"); } else { - CurUnoDialog.getPeerConfiguration().setImageUrl(aOrientationImage, 1000); + CurUnoDialog.getPeerConfiguration().setImageUrl(aOrientationImage, "private:graphicrepository/wizards/res/portrait_32.png"); } } catch (Exception exception) @@ -267,7 +267,7 @@ public class ReportLayouter catch (com.sun.star.lang.IllegalArgumentException e) { } - Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, CurUnoDialog.getWizardImageUrl(1002)); + Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, "private:graphicrepository/wizards/res/landscape_32.png"); break; @@ -282,7 +282,7 @@ public class ReportLayouter } CurUnoDialog.setControlProperty("imgOrientation", PropertyNames.PROPERTY_IMAGEURL, Desktop.getBitmapPath(m_xMSF) + "/portrait.gif"); - Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, CurUnoDialog.getWizardImageUrl(1000)); + Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, "private:graphicrepository/wizards/res/portrait_32.png"); break; default: diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 3bb1489f36ae..447a7d1325e4 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -62,7 +62,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private int m_nCurrentSelection = -1; private int pageStart = 0; public int helpURL = 0; - private IImageRenderer renderer; + private IRenderer renderer; private ListModel listModel; private IRenderer counterRenderer = new SimpleCounterRenderer(); private static final int LINE_HEIGHT = 8; @@ -195,7 +195,6 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener m_aButtons = new XControl[rows * cols]; - m_aButtonHeight = Integer.valueOf(m_aButtonSize.Height); m_aButtonWidth = Integer.valueOf(m_aButtonSize.Width); @@ -285,10 +284,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener } for (int i = 0; i < m_aButtons.length; i++) { - Object oObj = getObjectFor(i); - if (oObj == null) - continue; - Object oResource = renderer.getImageUrl(oObj); + String oResource = getObjectFor(i); if (oResource == null) continue; oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResource); @@ -329,9 +325,9 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener /** * @param i - * @return the Object in the list model corresponding to the given image index. + * @return the String in the list model corresponding to the given image url */ - private Object getObjectFor(int i) + private String getObjectFor(int i) { int ii = getIndexFor(i); if (listModel.getSize() <= ii) @@ -340,7 +336,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener } else { - return listModel.getElementAt(ii); + return (String)listModel.getElementAt(ii); } } @@ -442,7 +438,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener pos = _size; } - public void setRenderer(IImageRenderer _renderer) + public void setRenderer(IRenderer _renderer) { this.renderer = _renderer; } @@ -522,15 +518,6 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener return UnoRuntime.queryInterface(XControl.class, control).getModel(); } - public interface IImageRenderer extends IRenderer - { - - /** - * @return a resource ids for an image referenced in the resourcefile of the wizards project - */ - Object getImageUrl(Object listItem); - } - private static class SimpleCounterRenderer implements IRenderer { diff --git a/wizards/com/sun/star/wizards/ui/ImageList.py b/wizards/com/sun/star/wizards/ui/ImageList.py index 2e65eec55dae..870f2db32f71 100644 --- a/wizards/com/sun/star/wizards/ui/ImageList.py +++ b/wizards/com/sun/star/wizards/ui/ImageList.py @@ -223,17 +223,6 @@ class ImageList(ListDataListener): i.Visible = False focusable = True - for index, item in enumerate(self.m_aImages): - oResource = self.renderer.getImageUrl(self.getObjectFor(index)) - if oResource is not None: - self.oUnoDialog.getPeerConfiguration().setImageUrl( - item.Model, oResource) - - item.Model.Tabstop = bool(focusable) - if self.refreshOverNull: - item.Visible = True - - focusable = False self.refreshSelection() @@ -444,14 +433,6 @@ class ImageList(ListDataListener): def getSelectedObjects(self): return[self.listModel.getElementAt(self.selected)] - class IImageRenderer(IRenderer): - - # @param listItem - # @return resource id for an image referenced in the resourcefile of the wizards project - @abstractmethod - def getImageUrl(self, listItem): - pass - class SimpleCounterRenderer(IRenderer): def render(self, counter): diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.java b/wizards/com/sun/star/wizards/ui/PeerConfig.java index 07f6258a584a..8f0e2680a849 100644 --- a/wizards/com/sun/star/wizards/ui/PeerConfig.java +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.java @@ -59,11 +59,10 @@ public class PeerConfig implements XWindowListener private static class ImageUrlTask { - Object oModel; - Object oResource; + String oResource; - public ImageUrlTask(Object _oModel, Object _oResource) + public ImageUrlTask(Object _oModel, String _oResource) { oResource = _oResource; oModel = _oModel; @@ -94,15 +93,7 @@ public class PeerConfig implements XWindowListener for (int i = 0; i < this.aImageUrlTasks.size(); i++) { ImageUrlTask aImageUrlTask = aImageUrlTasks.get(i); - String sImageUrl = PropertyNames.EMPTY_STRING; - if (AnyConverter.isInt(aImageUrlTask.oResource)) - { - sImageUrl = oUnoDialog.getWizardImageUrl(((Integer) aImageUrlTask.oResource).intValue()); - } - else if (AnyConverter.isString(aImageUrlTask.oResource)) - { - sImageUrl = (String) aImageUrlTask.oResource; - } + String sImageUrl = aImageUrlTask.oResource; if (!sImageUrl.equals(PropertyNames.EMPTY_STRING)) { Helper.setUnoPropertyValue(aImageUrlTask.oModel, PropertyNames.PROPERTY_IMAGEURL, sImageUrl); @@ -157,15 +148,4 @@ public class PeerConfig implements XWindowListener ImageUrlTask oImageUrlTask = new ImageUrlTask(_ocontrolmodel, _sResourceUrl); this.aImageUrlTasks.add(oImageUrlTask); } - - /** - * Assigns an image to the property 'ImageUrl' of a dialog control. The image id must be assigned in a resource file - * within the wizards project - * wizards project - */ - public void setImageUrl(Object _ocontrolmodel, Object _oResource) - { - ImageUrlTask oImageUrlTask = new ImageUrlTask(_ocontrolmodel, _oResource); - this.aImageUrlTasks.add(oImageUrlTask); - } } diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.py b/wizards/com/sun/star/wizards/ui/PeerConfig.py index 241d1fdb1fa9..20a3406c21d5 100644 --- a/wizards/com/sun/star/wizards/ui/PeerConfig.py +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.py @@ -54,10 +54,7 @@ class PeerConfig(object): xVclWindowPeer.setProperty(i.propnames, i.propvalues) for aImageUrlTask in self.aImageUrlTasks: - if isinstance(aImageUrlTask.oResource, int): - sImageUrl = self.oUnoDialog.getWizardImageUrl(aImageUrlTask.oResource) - elif isinstance(aImageUrlTask.oResource, str): - sImageUrl = aImageUrlTask.oResource + sImageUrl = aImageUrlTask.oResource if sImageUrl != "": aImageUrlTask.oModel.ImageURL = sImageUrl diff --git a/wizards/com/sun/star/wizards/ui/UIConsts.java b/wizards/com/sun/star/wizards/ui/UIConsts.java index 950145f29639..5aeacb03b03b 100644 --- a/wizards/com/sun/star/wizards/ui/UIConsts.java +++ b/wizards/com/sun/star/wizards/ui/UIConsts.java @@ -27,13 +27,8 @@ public interface UIConsts int RID_QUERY = 2300; int RID_REPORT = 2400; int RID_TABLE = 2600; - int RID_IMG_FORM = 1100; Integer INVISIBLESTEP = 99; - /* - This is BMP_EXCEPTION_INFO (RID_IMAGE_START + 5, where RID_IMAGE_START + 5 is - RID_DBACCESS_START which is RID_LIB_START+9200 where RID_LIB_START is 10000) - */ - String INFOIMAGEURL = "private:resource/dbu/bitmapex/19205"; + String INFOIMAGEURL = "private:graphicrepository/dbaccess/res/exinfo.png"; /** * The tabindex of the navigation buttons in a wizard must be assigned a very * high tabindex because on every step their taborder must appear at the end diff --git a/wizards/com/sun/star/wizards/ui/UIConsts.py b/wizards/com/sun/star/wizards/ui/UIConsts.py index 271e6f5411c5..b3026cf0590a 100644 --- a/wizards/com/sun/star/wizards/ui/UIConsts.py +++ b/wizards/com/sun/star/wizards/ui/UIConsts.py @@ -22,15 +22,8 @@ class UIConsts(): RID_FORM = 2200 RID_QUERY = 2300 RID_REPORT = 2400 - RID_IMG_REPORT = 1000 - RID_IMG_FORM = 1100 - RID_IMG_WEB = 1200 INVISIBLESTEP = 99 - ''' - This is BMP_EXCEPTION_INFO (RID_IMAGE_START + 5, where RID_IMAGE_START + 5 is - RID_DBACCESS_START which is RID_LIB_START+9200 where RID_LIB_START is 10000) - ''' - INFOIMAGEURL = "private:resource/dbu/bitmapex/19205" + INFOIMAGEURL = "private:graphicrepository/dbaccess/res/exinfo.png" ''' The tabindex of the navigation buttons in a wizard must be assigned a very diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java index c04db3dec926..ee20c710d1f0 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java @@ -829,11 +829,6 @@ public class UnoDialog return nBlue; } - public String getWizardImageUrl(int _nResId) - { - return "private:resource/wzi/bitmapex/" + _nResId; - } - public static short getListBoxLineCount() { return (short)20; diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.py b/wizards/com/sun/star/wizards/ui/UnoDialog.py index 118a4e503a60..d73f828a4116 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.py +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.py @@ -367,6 +367,3 @@ class UnoDialog(object): nGreenModulo = (nRedModulo % 256) nBlue = nGreenModulo return nBlue - - def getWizardImageUrl(self, _nResId): - return "private:resource/wzi/bitmapex/" + str(_nResId) diff --git a/wizards/source/imagelists/imagelists.ilst b/wizards/source/imagelists/imagelists.ilst new file mode 100644 index 000000000000..0a6714c655eb --- /dev/null +++ b/wizards/source/imagelists/imagelists.ilst @@ -0,0 +1,7 @@ +%MODULE%/dbaccess/res/exinfo.png +%MODULE%/wizards/res/portrait_32.png +%MODULE%/wizards/res/landscape_32.png +%MODULE%/wizards/res/formarrangelistside_42.png +%MODULE%/wizards/res/formarrangelisttop_42.png +%MODULE%/wizards/res/formarrangetable_42.png +%MODULE%/wizards/res/formarrangefree_42.png diff --git a/wizards/source/imagelists/imagelists.src b/wizards/source/imagelists/imagelists.src deleted file mode 100644 index 592cd52ae5ba..000000000000 --- a/wizards/source/imagelists/imagelists.src +++ /dev/null @@ -1,59 +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 . - */ - -#define REPORTWIZARD_BASE 1000 -#define FORMWIZARD_BASE 1100 - -#define BMP_REPORT_ORIENTATION_PORTRAIT REPORTWIZARD_BASE + 0 -Bitmap BMP_REPORT_ORIENTATION_PORTRAIT -{ - File = "portrait_32.png"; -}; - -#define BMP_REPORT_ORIENTATION_LANDSCAPE REPORTWIZARD_BASE + 2 -Bitmap BMP_REPORT_ORIENTATION_LANDSCAPE -{ - File = "landscape_32.png"; -}; - -#define BMP_FORM_ARRANGELISTSIDE FORMWIZARD_BASE + 0 -Bitmap BMP_FORM_ARRANGELISTSIDE -{ - File = "formarrangelistside_42.png"; -}; - -#define BMP_FORM_ARRANGELISTTOP FORMWIZARD_BASE + 2 -Bitmap BMP_FORM_ARRANGELISTTOP -{ - File = "formarrangelisttop_42.png"; -}; - -#define BMP_FORM_ARRANGETABLE FORMWIZARD_BASE + 4 -Bitmap BMP_FORM_ARRANGETABLE -{ - File = "formarrangetable_42.png"; -}; - -#define BMP_FORM_ARRANGEFREE FORMWIZARD_BASE + 6 -Bitmap BMP_FORM_ARRANGEFREE -{ - File = "formarrangefree_42.png"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit