diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-18 21:14:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-19 15:40:40 +0200 |
commit | 2155e04d6343638ca9815d394cbc4f78c2b17c3a (patch) | |
tree | 0378142f6ce9edb63074291aed45527568e7b254 /sd/source/ui/app | |
parent | cee02e81cd3b55fb46eacf5db5713e8bf4363bcd (diff) |
make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/app')
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod2.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/app/sdpopup.cxx | 18 | ||||
-rw-r--r-- | sd/source/ui/app/sdresid.cxx | 30 | ||||
-rw-r--r-- | sd/source/ui/app/tmplctrl.cxx | 2 |
5 files changed, 22 insertions, 52 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 53d0750ede7b..094becb271fc 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -232,7 +232,7 @@ void SdModule::Execute(SfxRequest& rReq) } else { - ScopedVclPtrInstance<MessageDialog>(nullptr, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE))->Execute(); + ScopedVclPtrInstance<MessageDialog>(nullptr, SdResId(STR_CANT_PERFORM_IN_LIVEMODE))->Execute(); const SfxLinkItem* pLinkItem = rReq.GetArg<SfxLinkItem>(SID_DONELINK); if( pLinkItem ) diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index c19ae34d1919..4ddeb6ff5eec 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -245,7 +245,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum); } else - aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER).toString(); + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER); pInfo->SetRepresentation( aRepresentation ); } @@ -275,8 +275,8 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) { DocumentType eDocType = pDoc ? pDoc->GetDocumentType() : DocumentType::Impress; aRepresentation = ( ( eDocType == DocumentType::Impress ) - ? SdResId(STR_FIELD_PLACEHOLDER_SLIDENAME).toString() - : SdResId(STR_FIELD_PLACEHOLDER_PAGENAME).toString() ); + ? SdResId(STR_FIELD_PLACEHOLDER_SLIDENAME) + : SdResId(STR_FIELD_PLACEHOLDER_PAGENAME) ); } pInfo->SetRepresentation( aRepresentation ); @@ -315,7 +315,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) if( nPageCount > 0 ) aRepresentation = pDoc->CreatePageNumValue(nPageCount); else - aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_COUNT).toString(); + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_COUNT); pInfo->SetRepresentation( aRepresentation ); } @@ -361,11 +361,11 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) if( (pPage == nullptr) || bMasterView ) { if( bHeaderField ) - aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_HEADER).toString(); + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_HEADER); else if (bFooterField ) - aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_FOOTER).toString(); + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_FOOTER); else if (bDateTimeField ) - aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_DATETIME).toString(); + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_DATETIME); } else { @@ -806,14 +806,14 @@ SfxStyleFamilies* SdModule::CreateStyleFamilies() SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies; pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para, - SD_RESSTR(STR_GRAPHICS_STYLE_FAMILY), + SdResId(STR_GRAPHICS_STYLE_FAMILY), Image(BitmapEx(BMP_STYLES_FAMILY_GRAPHICS)), - SdResId(RID_GRAPHICSTYLEFAMILY))); + ResId(RID_GRAPHICSTYLEFAMILY, *SD_MOD()->GetResMgr()))); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Pseudo, - SD_RESSTR(STR_PRESENTATIONS_STYLE_FAMILY), + SdResId(STR_PRESENTATIONS_STYLE_FAMILY), Image(BitmapEx(BMP_STYLES_FAMILY_PRESENTATIONS)), - SdResId(RID_PRESENTATIONSTYLEFAMILY))); + ResId(RID_PRESENTATIONSTYLEFAMILY, *SD_MOD()->GetResMgr()))); return pStyleFamilies; } diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 02c7ff23c0c6..0f0efa786622 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -51,8 +51,8 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) { sal_uInt16 nID = 1; MenuItemBits nStyle = MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK; - InsertItem( nID++, SD_RESSTR( STR_FIX ), nStyle ); - InsertItem( nID++, SD_RESSTR( STR_VAR ), nStyle ); + InsertItem( nID++, SdResId( STR_FIX ), nStyle ); + InsertItem( nID++, SdResId( STR_VAR ), nStyle ); InsertSeparator(); if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) @@ -67,8 +67,8 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SVXDATEFORMAT_APPDEFAULT, // is not used //SVXDATEFORMAT_SYSTEM, // is not used - InsertItem( nID++, SD_RESSTR( STR_STANDARD_SMALL ), nStyle ); - InsertItem( nID++, SD_RESSTR( STR_STANDARD_BIG ), nStyle ); + InsertItem( nID++, SdResId( STR_STANDARD_SMALL ), nStyle ); + InsertItem( nID++, SdResId( STR_STANDARD_BIG ), nStyle ); SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); aDateField.SetFormat( SVXDATEFORMAT_A ); // 13.02.96 @@ -99,7 +99,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SVXTIMEFORMAT_APPDEFAULT, // is not used //SVXTIMEFORMAT_SYSTEM, // is not used - InsertItem( nID++, SD_RESSTR( STR_STANDARD_NORMAL ), nStyle ); + InsertItem( nID++, SdResId( STR_STANDARD_NORMAL ), nStyle ); SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49 @@ -131,10 +131,10 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) else CheckItem( 2 ); - InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_NAME_EXT ), nStyle ); - InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_FULLPATH ), nStyle ); - InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_PATH ), nStyle ); - InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_NAME ), nStyle ); + InsertItem( nID++, SdResId( STR_FILEFORMAT_NAME_EXT ), nStyle ); + InsertItem( nID++, SdResId( STR_FILEFORMAT_FULLPATH ), nStyle ); + InsertItem( nID++, SdResId( STR_FILEFORMAT_PATH ), nStyle ); + InsertItem( nID++, SdResId( STR_FILEFORMAT_NAME ), nStyle ); CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 ); } diff --git a/sd/source/ui/app/sdresid.cxx b/sd/source/ui/app/sdresid.cxx deleted file mode 100644 index c91e982a0b7c..000000000000 --- a/sd/source/ui/app/sdresid.cxx +++ /dev/null @@ -1,30 +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 . - */ - -#include "sdmod.hxx" -#include "sdresid.hxx" -#include <sal/types.h> - -// Ctor -SdResId::SdResId(sal_uInt16 nId) : - ResId(nId, *SD_MOD()->GetResMgr()) -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index ea5db97a6d64..685d39d6d889 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -66,7 +66,7 @@ SdTemplateControl::SdTemplateControl( sal_uInt16 _nSlotId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ) { - GetStatusBar().SetQuickHelpText(GetId(), SD_RESSTR(STR_STATUSBAR_MASTERPAGE)); + GetStatusBar().SetQuickHelpText(GetId(), SdResId(STR_STATUSBAR_MASTERPAGE)); } SdTemplateControl::~SdTemplateControl() |