summaryrefslogtreecommitdiff
path: root/sd/source/ui/sidebar
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /sd/source/ui/sidebar
parentfa987cbb813cfd729fe490f2f1258b7c8d7fb174 (diff)
migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx2
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx16
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx50
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx4
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx5
5 files changed, 35 insertions, 42 deletions
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index 0512139aaf90..4e9a31d69bcf 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -28,7 +28,7 @@
#include "EventMultiplexer.hxx"
#include "app.hrc"
#include "DrawDocShell.hxx"
-#include "res_bmp.hrc"
+
#include "sdresid.hxx"
#include "helpids.h"
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index ef39e00b5fc1..1c6782d424a8 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -22,11 +22,11 @@
#include "app.hrc"
#include "drawdoc.hxx"
#include "framework/FrameworkHelper.hxx"
-#include "glob.hrc"
+#include "strings.hrc"
#include "glob.hxx"
#include "helpids.h"
#include "pres.hxx"
-#include "res_bmp.hrc"
+
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "strings.hrc"
@@ -69,7 +69,7 @@ namespace sd { namespace sidebar {
struct snewfoil_value_info
{
const char* msBmpResId;
- sal_uInt16 mnStrResId;
+ const char* mpStrResId;
WritingMode meWritingMode;
AutoLayout maAutoLayout;
};
@@ -78,7 +78,7 @@ static const snewfoil_value_info notes[] =
{
{BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
AUTOLAYOUT_NOTES},
- {"", 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+ {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE},
};
static const snewfoil_value_info handout[] =
@@ -95,7 +95,7 @@ static const snewfoil_value_info handout[] =
AUTOLAYOUT_HANDOUT6},
{BMP_FOILH_09, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB,
AUTOLAYOUT_HANDOUT9},
- {"", 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+ {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE},
};
static const snewfoil_value_info standard[] =
@@ -118,7 +118,7 @@ static const snewfoil_value_info standard[] =
{BMP_LAYOUT_VERTICAL01, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VTITLE_VCONTENT},
{BMP_LAYOUT_HEAD02, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VCONTENT},
{BMP_LAYOUT_HEAD02A, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_2VTEXT},
- {"", 0, WritingMode_LR_TB, AUTOLAYOUT_NONE}
+ {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE}
};
LayoutMenu::LayoutMenu (
@@ -538,7 +538,7 @@ void LayoutMenu::Fill()
}
Clear();
- for (sal_uInt16 i=1; pInfo!=nullptr && pInfo->mnStrResId !=0; i++, pInfo++)
+ for (sal_uInt16 i=1; pInfo!=nullptr && pInfo->mpStrResId != nullptr; i++, pInfo++)
{
if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
{
@@ -547,7 +547,7 @@ void LayoutMenu::Fill()
if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
aBmp.Mirror (BmpMirrorFlags::Horizontal);
- InsertItem(i, Image(aBmp), SdResId (pInfo->mnStrResId));
+ InsertItem(i, Image(aBmp), SdResId(pInfo->mpStrResId));
SetItemData (i, new AutoLayout(pInfo->maAutoLayout));
}
}
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index e905b85254bd..a1d3f3f93b7b 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -166,7 +166,7 @@ private:
typedef ::std::pair<MasterPageContainerChangeEvent::EventType,Token> EventData;
- Image GetPreviewSubstitution (sal_uInt16 nId, PreviewSize ePreviewSize);
+ Image GetPreviewSubstitution(const char* pId, PreviewSize ePreviewSize);
void CleanContainer();
};
@@ -867,44 +867,38 @@ SdDrawDocument* MasterPageContainer::Implementation::GetDocument()
}
Image MasterPageContainer::Implementation::GetPreviewSubstitution (
- sal_uInt16 nId,
+ const char* pId,
PreviewSize ePreviewSize)
{
const ::osl::MutexGuard aGuard (maMutex);
Image aPreview;
- switch (nId)
+ if (strcmp(pId, STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION) == 0)
{
- case STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION:
+ Image& rPreview (ePreviewSize==SMALL
+ ? maSmallPreviewBeingCreated
+ : maLargePreviewBeingCreated);
+ if (rPreview.GetSizePixel().Width() == 0)
{
- Image& rPreview (ePreviewSize==SMALL
- ? maSmallPreviewBeingCreated
- : maLargePreviewBeingCreated);
- if (rPreview.GetSizePixel().Width() == 0)
- {
- rPreview = maPreviewRenderer.RenderSubstitution(
- ePreviewSize==SMALL ? maSmallPreviewSizePixel : maLargePreviewSizePixel,
- SdResId(STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION));
- }
- aPreview = rPreview;
+ rPreview = maPreviewRenderer.RenderSubstitution(
+ ePreviewSize==SMALL ? maSmallPreviewSizePixel : maLargePreviewSizePixel,
+ SdResId(STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION));
}
- break;
-
- case STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION:
+ aPreview = rPreview;
+ }
+ else if (strcmp(pId, STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION) == 0)
+ {
+ Image& rPreview (ePreviewSize==SMALL
+ ? maSmallPreviewNotAvailable
+ : maLargePreviewNotAvailable);
+ if (rPreview.GetSizePixel().Width() == 0)
{
- Image& rPreview (ePreviewSize==SMALL
- ? maSmallPreviewNotAvailable
- : maLargePreviewNotAvailable);
- if (rPreview.GetSizePixel().Width() == 0)
- {
- rPreview = maPreviewRenderer.RenderSubstitution(
- ePreviewSize==SMALL ? maSmallPreviewSizePixel : maLargePreviewSizePixel,
- SdResId(STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION));
- }
- aPreview = rPreview;
+ rPreview = maPreviewRenderer.RenderSubstitution(
+ ePreviewSize==SMALL ? maSmallPreviewSizePixel : maLargePreviewSizePixel,
+ SdResId(STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION));
}
- break;
+ aPreview = rPreview;
}
return aPreview;
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index edd6d0f19414..982519c1bf2f 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -30,9 +30,9 @@
#include "DrawDocShell.hxx"
#include "sdpage.hxx"
#include "glob.hxx"
-#include "glob.hrc"
+#include "strings.hrc"
#include "app.hrc"
-#include "res_bmp.hrc"
+
#include "strings.hrc"
#include "DrawViewShell.hxx"
#include "DrawController.hxx"
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index a0c2e756e42c..bb9f723ff2dd 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -34,14 +34,13 @@
#include "DrawViewShell.hxx"
#include "DrawController.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <svtools/controldims.hrc>
+#include <svtools/controldims.hxx>
#include <svx/colorbox.hxx>
#include <svx/gallery.hxx>
#include <svx/drawitem.hxx>
#include <unotools/pathoptions.hxx>
#include <vcl/msgbox.hxx>
#include <tools/urlobj.hxx>
-#include <tools/resary.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include "app.hrc"
#include <editeng/paperinf.hxx>
@@ -62,7 +61,7 @@
#include <sfx2/tabdlg.hxx>
#include <algorithm>
#include "EventMultiplexer.hxx"
-#include "glob.hrc"
+#include "strings.hrc"
#include <vcl/salbtype.hxx>
#include <vcl/EnumContext.hxx>