From f86a784f8fb1f5bf0a14d723855ad6ad9d342532 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Sun, 9 Nov 2025 11:13:37 +0100 Subject: [PATCH] tdf#61950 Move Presentation Minimizer UI strings out of officecfg Change-Id: I8a9bba8cdde89a87340ed9dd46dbac53b6806e9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193654 Tested-by: Jenkins Reviewed-by: Andras Timar --- Repository.mk | 1 + .../Office/PresentationMinimizer.xcu | 81 ------------- .../Office/PresentationMinimizer.xcs | 109 ------------------ sdext/AllLangMoTarget_sdext.mk | 14 +++ sdext/Library_PresentationMinimizer.mk | 2 + sdext/Module_sdext.mk | 4 + sdext/inc/sdextresid.hxx | 16 +++ sdext/inc/strings.hrc | 41 +++++++ .../source/minimizer/configurationaccess.cxx | 41 ------- .../source/minimizer/configurationaccess.hxx | 2 - sdext/source/minimizer/impoptimizer.cxx | 16 +-- sdext/source/minimizer/informationdialog.cxx | 18 +-- sdext/source/minimizer/optimizerdialog.cxx | 20 ++-- .../minimizer/optimizerdialogcontrols.cxx | 14 ++- sdext/source/minimizer/pppoptimizertoken.cxx | 26 ----- sdext/source/minimizer/pppoptimizertoken.hxx | 25 ---- sdext/source/minimizer/sdextresid.cxx | 15 +++ 17 files changed, 131 insertions(+), 314 deletions(-) create mode 100644 sdext/AllLangMoTarget_sdext.mk create mode 100644 sdext/inc/sdextresid.hxx create mode 100644 sdext/inc/strings.hrc create mode 100644 sdext/source/minimizer/sdextresid.cxx diff --git a/Repository.mk b/Repository.mk index 2068a2b70b1e..d6219fccf094 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1214,6 +1214,7 @@ $(eval $(call gb_Helper_register_mos,\ sca \ scc \ sd \ + sdext \ sfx \ shell \ sm \ diff --git a/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu b/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu index 8f93e4843d69..f784825ecd48 100644 --- a/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu +++ b/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu @@ -18,87 +18,6 @@ --> - - - Presentation Minimizer - - - Introduction - - - Images - - - OLE Objects - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains OLE objects. - - - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - Slides - - - Summary - - - Delete %SLIDES slides. - - - Optimize %IMAGES images to %QUALITY% JPEG quality at %RESOLUTION DPI. - - - Create replacement images for %OLE objects. - - - My Settings - - - OK - - - Successfully updated the presentation “%TITLE”. - - - The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - - - The file size has changed from %OLDFILESIZE MB to approximately %NEWFILESIZE MB. - - - The file size has changed to %NEWFILESIZE MB. - - - The file size has changed to approximately %NEWFILESIZE MB. - - - Duplicating presentation... - - - Deleting slides... - - - Optimizing images... - - - Creating replacement images for OLE objects... - - - . - - - (minimized) - - - Do you want to minimize presentation without saving? - - Projector optimized diff --git a/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs b/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs index 683cf47c359a..4159bf50365e 100644 --- a/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs @@ -123,115 +123,6 @@ - - UI strings. - - String STR_SUN_OPTIMIZATION_WIZARD2 - Presentation Minimizer - - - String STR_INTRODUCTION. - Introduction - - - String STR_IMAGE_OPTIMIZATION. - Images - - - String STR_OLE_OBJECTS. - OLE Objects - - - String STR_OLE_OBJECTS_DESC. - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - String STR_NO_OLE_OBJECTS_DESC. - Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects. - -The current presentation contains no OLE objects. - - - String STR_SLIDES. - Slides - - - String STR_SUMMARY. - Summary - - - String STR_DELETE_SLIDES. - Delete %SLIDES slides - - - - The following string is only used in plural. - - Optimize %IMAGES images to %QUALITY% JPEG quality at %RESOLUTION DPI. - - - String STR_CREATE_REPLACEMENT. - Create replacement images for %OLE objects. - - - String MY_SETTINGS. - My Settings - - - String STR_OK. - OK - - - String STR_INFO_SECONDARY_1. - The Presentation Minimizer has successfully updated the presentation '%TITLE'. - - - String STR_INFO_SECONDARY_1. - The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - - - String STR_INFO_SECONDARY_2. - The file size has changed from %OLDFILESIZE MB to approximately %NEWFILESIZE MB. - - - String STR_INFO_SECONDARY_3. - The file size has changed to %NEWFILESIZE MB. - - - String STR_INFO_SECONDARY_4. - The file size has changed to approximately %NEWFILESIZE MB. - - - String STR_DUPLICATING_PRESENTATION. - Duplicating presentation... - - - String STR_DELETING_SLIDES. - Deleting slides... - - - String STR_OPTIMIZING_GRAPHICS. - Optimizing images... - - - String STR_CREATING_OLE_REPLACEMENTS. - Creating replacement images for OLE objects... - - - String STR_FILESIZESEPARATOR. - . - - - String STR_FILENAME_SUFFIX. - (minimized) - - - String STR_WARN_UNSAVED_PRESENTATION. - Do you want to minimize presentation without saving? - - describes the name of the last used settings diff --git a/sdext/AllLangMoTarget_sdext.mk b/sdext/AllLangMoTarget_sdext.mk new file mode 100644 index 000000000000..7d309d0a5290 --- /dev/null +++ b/sdext/AllLangMoTarget_sdext.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# 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/. +# + +$(eval $(call gb_AllLangMoTarget_AllLangMoTarget,sdext)) + +$(eval $(call gb_AllLangMoTarget_set_polocation,sdext,sdext)) + +# vim: set noet sw=4 ts=4: diff --git a/sdext/Library_PresentationMinimizer.mk b/sdext/Library_PresentationMinimizer.mk index 9118017a8cff..16915f9c2f4e 100644 --- a/sdext/Library_PresentationMinimizer.mk +++ b/sdext/Library_PresentationMinimizer.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Library_use_libraries,PresentationMinimizer,\ sal \ sfx \ svt \ + utl \ vcl \ tl \ )) @@ -53,6 +54,7 @@ $(eval $(call gb_Library_add_exception_objects,PresentationMinimizer,\ sdext/source/minimizer/pppoptimizer \ sdext/source/minimizer/pppoptimizerdialog \ sdext/source/minimizer/pppoptimizertoken \ + sdext/source/minimizer/sdextresid \ )) # vim:set noet sw=4 ts=4: diff --git a/sdext/Module_sdext.mk b/sdext/Module_sdext.mk index 1522d214470f..bfb5b0ffadcb 100644 --- a/sdext/Module_sdext.mk +++ b/sdext/Module_sdext.mk @@ -13,6 +13,10 @@ $(eval $(call gb_Module_add_targets,sdext,\ Library_PresentationMinimizer \ )) +$(eval $(call gb_Module_add_l10n_targets,sdext,\ + AllLangMoTarget_sdext \ +)) + ifeq ($(ENABLE_PDFIMPORT),TRUE) $(eval $(call gb_Module_add_targets,sdext,\ CustomTarget_pdfimport \ diff --git a/sdext/inc/sdextresid.hxx b/sdext/inc/sdextresid.hxx new file mode 100644 index 000000000000..58ffe912d5a4 --- /dev/null +++ b/sdext/inc/sdextresid.hxx @@ -0,0 +1,16 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include + +OUString SdextResId(TranslateId aKey); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sdext/inc/strings.hrc b/sdext/inc/strings.hrc new file mode 100644 index 000000000000..d59428737848 --- /dev/null +++ b/sdext/inc/strings.hrc @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#define NC_(Context, String) TranslateId(Context, u8##String) + +#define STR_SUN_OPTIMIZATION_WIZARD2 NC_("STR_SUN_OPTIMIZATION_WIZARD2", "Presentation Minimizer") +#define STR_INTRODUCTION NC_("STR_INTRODUCTION", "Introduction") +#define STR_IMAGE_OPTIMIZATION NC_("STR_IMAGE_OPTIMIZATION", "Images") +#define STR_OLE_OBJECTS NC_("STR_OLE_OBJECTS", "OLE Objects") +#define STR_OLE_OBJECTS_DESC NC_("STR_OLE_OBJECTS_DESC", "Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.\n\nThe current presentation contains OLE objects.") +#define STR_NO_OLE_OBJECTS_DESC NC_("STR_NO_OLE_OBJECTS_DESC", "Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.\n\nThe current presentation contains no OLE objects.") +#define STR_SLIDES NC_("STR_SLIDES", "Slides") +#define STR_SUMMARY NC_("STR_SUMMARY", "Summary") +#define STR_DELETE_SLIDES NC_("STR_DELETE_SLIDES", "Delete %SLIDES slides.") +// The following string is only used in plural. +#define STR_OPTIMIZE_IMAGES NC_("STR_OPTIMIZE_IMAGES", "Optimize %IMAGES images to %QUALITY% JPEG quality at %RESOLUTION DPI.") +#define STR_CREATE_REPLACEMENT NC_("STR_CREATE_REPLACEMENT", "Create replacement images for %OLE objects.") +#define STR_MY_SETTINGS NC_("STR_MY_SETTINGS", "My Settings ") +#define STR_OK NC_("STR_OK", "OK") +#define STR_INFO_PRIMARY NC_("STR_INFO_PRIMARY", "Successfully updated the presentation “%TITLE”.") +#define STR_INFO_SECONDARY_1 NC_("STR_INFO_SECONDARY_1", "The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB.") +#define STR_INFO_SECONDARY_2 NC_("STR_INFO_SECONDARY_2", "The file size has changed from %OLDFILESIZE MB to approximately %NEWFILESIZE MB.") +#define STR_INFO_SECONDARY_3 NC_("STR_INFO_SECONDARY_3", "The file size has changed to %NEWFILESIZE MB.") +#define STR_INFO_SECONDARY_4 NC_("STR_INFO_SECONDARY_4", "The file size has changed to approximately %NEWFILESIZE MB.") +#define STR_DUPLICATING_PRESENTATION NC_("STR_DUPLICATING_PRESENTATION", "Duplicating presentation...") +#define STR_DELETING_SLIDES NC_("STR_DELETING_SLIDES", "Deleting slides...") +#define STR_OPTIMIZING_GRAPHICS NC_("STR_OPTIMIZING_GRAPHICS", "Optimizing images...") +#define STR_CREATING_OLE_REPLACEMENTS NC_("STR_CREATING_OLE_REPLACEMENTS", "Creating replacement images for OLE objects...") +#define STR_FILESIZESEPARATOR NC_("STR_FILESIZESEPARATOR", ".") +#define STR_FILENAME_SUFFIX NC_("STR_FILENAME_SUFFIX", "(minimized)") +#define STR_WARN_UNSAVED_PRESENTATION NC_("STR_WARN_UNSAVED_PRESENTATION", "Do you want to minimize presentation without saving?") + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx index de2a582a93eb..2acab6df88e3 100644 --- a/sdext/source/minimizer/configurationaccess.cxx +++ b/sdext/source/minimizer/configurationaccess.cxx @@ -145,7 +145,6 @@ bool OptimizerSettings::operator==( const OptimizerSettings& rOptimizerSettings ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxContext ) : mxContext( rxContext ) { - LoadStrings(); maSettings.emplace_back( ); maSettings.back().maName = "LastUsedSettings"; LoadConfiguration(); @@ -155,46 +154,6 @@ ConfigurationAccess::~ConfigurationAccess() { } -OUString ConfigurationAccess::getString( const PPPOptimizerTokenEnum eToken ) const -{ - std::map< PPPOptimizerTokenEnum, OUString >::const_iterator aIter( maStrings.find( eToken ) ); - return aIter != maStrings.end() ? ((*aIter).second) : OUString(); -} - -void ConfigurationAccess::LoadStrings() -{ - try - { - do - { - Reference< XInterface > xRoot( OpenConfiguration( true ) ); - if ( !xRoot.is() ) - break; - Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, u"Strings"_ustr ), UNO_QUERY ); - if ( xSet.is() ) - { - const Sequence< OUString > aElements( xSet->getElementNames() ); - for ( const auto& rElement : aElements ) - { - try - { - OUString aString, aPropertyName( rElement ); - if ( xSet->getByName( aPropertyName ) >>= aString ) - maStrings[ TKGet( aPropertyName ) ] = aString; - } - catch (const Exception&) - { - } - } - } - } - while( false ); - } - catch (const Exception&) - { - } -} - void ConfigurationAccess::LoadConfiguration() { try diff --git a/sdext/source/minimizer/configurationaccess.hxx b/sdext/source/minimizer/configurationaccess.hxx index 5cf884fc13fe..820e0be95009 100644 --- a/sdext/source/minimizer/configurationaccess.hxx +++ b/sdext/source/minimizer/configurationaccess.hxx @@ -80,8 +80,6 @@ class ConfigurationAccess ~ConfigurationAccess(); void SaveConfiguration(); - OUString getString( const PPPOptimizerTokenEnum ) const; - // access to current OptimizerSettings (stored in the first entry of maSettings) css::uno::Any GetConfigProperty( const PPPOptimizerTokenEnum ) const; void SetConfigProperty( const PPPOptimizerTokenEnum, const css::uno::Any& aValue ); diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index f98e5fd59836..1149ddc21a9d 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -19,10 +19,12 @@ #include "impoptimizer.hxx" +#include #include "pppoptimizer.hxx" #include "graphiccollector.hxx" #include "pagecollector.hxx" #include "informationdialog.hxx" +#include #include #include @@ -491,14 +493,14 @@ void ImpOptimizer::Optimize() if ( mbDeleteHiddenSlides ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_DELETING_SLIDES ) ) ); DispatchStatus(); ImpDeleteHiddenSlides( mxModel ); } if ( mbDeleteNotesPages ) { - SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_DELETING_SLIDES) ) ); DispatchStatus(); ImpDeleteNotesPages( mxModel ); } @@ -506,7 +508,7 @@ void ImpOptimizer::Optimize() if ( mbDeleteUnusedMasterPages ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_DELETING_SLIDES ) ) ); DispatchStatus(); ImpDeleteUnusedMasterPages( mxModel ); } @@ -514,7 +516,7 @@ void ImpOptimizer::Optimize() if ( mbOLEOptimization ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 45 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_CREATING_OLE_REPLACEMENTS"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_CREATING_OLE_REPLACEMENTS ) ) ); DispatchStatus(); ImpConvertOLE( mxModel, mnOLEOptimizationType ); } @@ -522,7 +524,7 @@ void ImpOptimizer::Optimize() if ( mbJPEGCompression || mbRemoveCropArea || mnImageResolution ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 50 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_OPTIMIZING_GRAPHICS"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_OPTIMIZING_GRAPHICS) ) ); DispatchStatus(); std::vector< GraphicCollector::GraphicEntity > aGraphicList; @@ -610,7 +612,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 10 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_DUPLICATING_PRESENTATION"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_DUPLICATING_PRESENTATION ) ) ); DispatchStatus(); Reference< XStorable >xStorable( mxModel, UNO_QUERY ); @@ -633,7 +635,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments ) nSourceSize = PPPOptimizer::GetFileSize( maSaveAsURL ); SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 30 ) ) ); - SetStatusValue( TK_Status, Any( u"STR_DUPLICATING_PRESENTATION"_ustr ) ); + SetStatusValue( TK_Status, Any( SdextResId( STR_DUPLICATING_PRESENTATION ) ) ); DispatchStatus(); Reference< XDesktop2 > xDesktop = Desktop::create( mxContext ); diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx index 252863231bff..0782a906f130 100644 --- a/sdext/source/minimizer/informationdialog.cxx +++ b/sdext/source/minimizer/informationdialog.cxx @@ -19,6 +19,8 @@ #include "informationdialog.hxx" +#include +#include #include #include #include @@ -48,27 +50,27 @@ static OUString ImpValueOfInMB( sal_Int64 rVal ) void InformationDialog::InitDialog() { - set_title(getString(STR_SUN_OPTIMIZATION_WIZARD2)); + set_title( SdextResId( STR_SUN_OPTIMIZATION_WIZARD2 ) ); sal_Int64 nSource = mnSourceSize; sal_Int64 nDest = mnDestSize; - PPPOptimizerTokenEnum eInfoString( STR_INFO_SECONDARY_1 ); + OUString eInfoString( SdextResId( STR_INFO_SECONDARY_1 ) ); if ( mnSourceSize ) { if ( mnDestSize ) - eInfoString = STR_INFO_SECONDARY_1; + eInfoString = SdextResId( STR_INFO_SECONDARY_1 ) ; else { - eInfoString = STR_INFO_SECONDARY_2; + eInfoString = SdextResId( STR_INFO_SECONDARY_2 ); nDest = mnApproxSize; } } else if ( mnDestSize ) - eInfoString = STR_INFO_SECONDARY_3; + eInfoString = SdextResId( STR_INFO_SECONDARY_3 ); else { - eInfoString = STR_INFO_SECONDARY_4; + eInfoString = SdextResId( STR_INFO_SECONDARY_4 ); nDest = mnApproxSize; } @@ -88,8 +90,8 @@ void InformationDialog::InitDialog() aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(), u"" ); } - OUString sPrimary( getString( STR_INFO_PRIMARY ) ); - OUString sSecondary( getString( eInfoString ) ); + OUString sPrimary( SdextResId( STR_INFO_PRIMARY ) ); + OUString sSecondary( eInfoString ); static constexpr OUString aOldSizePlaceholder( u"%OLDFILESIZE"_ustr ); static constexpr OUString aNewSizePlaceholder( u"%NEWFILESIZE"_ustr ); const OUString aTitlePlaceholder( !aTitle.isEmpty() ? u"%TITLE"_ustr diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx index 9ccbe96cc9a4..1d152c33097a 100644 --- a/sdext/source/minimizer/optimizerdialog.cxx +++ b/sdext/source/minimizer/optimizerdialog.cxx @@ -21,6 +21,7 @@ #include "optimizerdialog.hxx" #include "impoptimizer.hxx" #include "fileopendialog.hxx" +#include #include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include using namespace ::com::sun::star::io; using namespace ::com::sun::star::ui; @@ -242,7 +244,7 @@ void SummaryPage::UpdateProgressValue(int nProgress) void OptimizerDialog::InitDialog() { - set_title(getString(STR_SUN_OPTIMIZATION_WIZARD2)); + set_title(SdextResId( STR_SUN_OPTIMIZATION_WIZARD2 )); } void OptimizerDialog::InitRoadmap() @@ -306,15 +308,15 @@ OUString OptimizerDialog::getStateDisplayName(vcl::WizardTypes::WizardState nSta switch (nState) { case ITEM_ID_INTRODUCTION: - return getString(STR_INTRODUCTION); + return SdextResId( STR_INTRODUCTION ); case ITEM_ID_SLIDES: - return getString(STR_SLIDES); + return SdextResId( STR_SLIDES ); case ITEM_ID_GRAPHIC_OPTIMIZATION: - return getString(STR_IMAGE_OPTIMIZATION); + return SdextResId( STR_IMAGE_OPTIMIZATION ); case ITEM_ID_OLE_OPTIMIZATION: - return getString(STR_OLE_OBJECTS); + return SdextResId( STR_OLE_OBJECTS ); case ITEM_ID_SUMMARY: - return getString(STR_SUMMARY); + return SdextResId( STR_SUMMARY ); } return OUString(); } @@ -392,7 +394,7 @@ void OptimizerDialog::UpdateStatus( const css::uno::Sequence< css::beans::Proper OUString sStatus; if ( *pVal >>= sStatus ) { - mpPage4->UpdateStatusLabel(getString(TKGet(sStatus))); + mpPage4->UpdateStatusLabel( sStatus ); } } pVal = maStats.GetStatusValue( TK_Progress ); @@ -524,7 +526,7 @@ bool OptimizerDialog::onFinish() if (!aName.isEmpty()) { - aName += " " + getString(STR_FILENAME_SUFFIX); + aName += " " + SdextResId( STR_FILENAME_SUFFIX ); aFileOpenDialog.setDefaultName(aName); } @@ -555,7 +557,7 @@ bool OptimizerDialog::onFinish() SolarMutexGuard aSolarGuard; std::unique_ptr popupDlg(Application::CreateMessageDialog( m_xAssistant.get(), VclMessageType::Question, VclButtonsType::YesNo, - getString(STR_WARN_UNSAVED_PRESENTATION))); + SdextResId( STR_WARN_UNSAVED_PRESENTATION ))); if (popupDlg->run() != RET_YES) { // Selected not "yes" ("no" or dialog was cancelled) so return to previous step diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx index 99f7740be9fa..5b7458b5a830 100644 --- a/sdext/source/minimizer/optimizerdialogcontrols.cxx +++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx @@ -19,6 +19,8 @@ #include "optimizerdialog.hxx" +#include +#include #include "pppoptimizer.hxx" @@ -145,7 +147,7 @@ void OptimizerDialog::InitPage3() } } - mpPage3->Init(nOLECount ? getString(STR_OLE_OBJECTS_DESC) : getString(STR_NO_OLE_OBJECTS_DESC)); + mpPage3->Init(nOLECount ? SdextResId( STR_OLE_OBJECTS_DESC ) : SdextResId( STR_NO_OLE_OBJECTS_DESC )); UpdateControlStatesPage3(); } @@ -229,7 +231,7 @@ void OptimizerDialog::UpdateControlStatesPage4() } if ( nDeletedSlides > 1 ) { - OUString aStr( getString( STR_DELETE_SLIDES ) ); + OUString aStr( SdextResId( STR_DELETE_SLIDES ) ); OUString aPlaceholder( u"%SLIDES"_ustr ); sal_Int32 i = aStr.indexOf( aPlaceholder ); if ( i >= 0 ) @@ -247,7 +249,7 @@ void OptimizerDialog::UpdateControlStatesPage4() GraphicCollector::CountGraphics( mxContext, mxController->getModel(), aGraphicSettings, nGraphics ); if ( nGraphics > 1 ) { - OUString aStr( getString( STR_OPTIMIZE_IMAGES ) ); + OUString aStr( SdextResId( STR_OPTIMIZE_IMAGES ) ); OUString aImagePlaceholder( u"%IMAGES"_ustr ); OUString aQualityPlaceholder( u"%QUALITY"_ustr ); OUString aResolutionPlaceholder( u"%RESOLUTION"_ustr ); @@ -283,7 +285,7 @@ void OptimizerDialog::UpdateControlStatesPage4() } if ( nOLEReplacements > 1 ) { - OUString aStr( getString( STR_CREATE_REPLACEMENT ) ); + OUString aStr( SdextResId( STR_CREATE_REPLACEMENT ) ); OUString aPlaceholder( u"%OLE"_ustr ); sal_Int32 i = aStr.indexOf( aPlaceholder ); if ( i >= 0 ) @@ -317,7 +319,7 @@ void OptimizerDialog::UpdateControlStatesPage4() nEstimatedFileSize = static_cast< sal_Int64 >( fE ); } sal_Unicode nSeparator = '.'; - OUString aStr( getString( STR_FILESIZESEPARATOR ) ); + OUString aStr( SdextResId( STR_FILESIZESEPARATOR ) ); if ( !aStr.isEmpty() ) nSeparator = aStr[ 0 ]; mpPage4->UpdateControlStates(bSaveAs, bSaveSettingsEnabled, aItemList, @@ -331,7 +333,7 @@ void OptimizerDialog::InitPage4() { // creating a default session name that hasn't been used yet OUString aSettingsName; - OUString aDefault( getString( STR_MY_SETTINGS ) ); + OUString aDefault( SdextResId( STR_MY_SETTINGS ) ); sal_Int32 nSession = 1; std::vector::size_type i; const std::vector< OptimizerSettings >& rList( GetOptimizerSettings() ); diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx b/sdext/source/minimizer/pppoptimizertoken.cxx index 985d107b464c..2ac08ee76aaa 100644 --- a/sdext/source/minimizer/pppoptimizertoken.cxx +++ b/sdext/source/minimizer/pppoptimizertoken.cxx @@ -73,32 +73,6 @@ constexpr TokenTable pTokenTableArray[] = { u"Status"_ustr, TK_Status }, { u"Pages"_ustr, TK_Pages }, - { u"STR_SUN_OPTIMIZATION_WIZARD2"_ustr,STR_SUN_OPTIMIZATION_WIZARD2 }, - { u"STR_INTRODUCTION"_ustr, STR_INTRODUCTION }, - { u"STR_IMAGE_OPTIMIZATION"_ustr, STR_IMAGE_OPTIMIZATION }, - { u"STR_OLE_OBJECTS"_ustr, STR_OLE_OBJECTS }, - { u"STR_OLE_OBJECTS_DESC"_ustr, STR_OLE_OBJECTS_DESC }, - { u"STR_NO_OLE_OBJECTS_DESC"_ustr, STR_NO_OLE_OBJECTS_DESC }, - { u"STR_SLIDES"_ustr, STR_SLIDES }, - { u"STR_SUMMARY"_ustr, STR_SUMMARY }, - { u"STR_DELETE_SLIDES"_ustr, STR_DELETE_SLIDES }, - { u"STR_OPTIMIZE_IMAGES"_ustr, STR_OPTIMIZE_IMAGES }, - { u"STR_CREATE_REPLACEMENT"_ustr, STR_CREATE_REPLACEMENT }, - { u"MY_SETTINGS"_ustr, STR_MY_SETTINGS }, - { u"STR_OK"_ustr, STR_OK }, - { u"STR_INFO_PRIMARY"_ustr, STR_INFO_PRIMARY }, - { u"STR_INFO_SECONDARY_1"_ustr, STR_INFO_SECONDARY_1 }, - { u"STR_INFO_SECONDARY_2"_ustr, STR_INFO_SECONDARY_2 }, - { u"STR_INFO_SECONDARY_3"_ustr, STR_INFO_SECONDARY_3 }, - { u"STR_INFO_SECONDARY_4"_ustr, STR_INFO_SECONDARY_4 }, - { u"STR_DUPLICATING_PRESENTATION"_ustr,STR_DUPLICATING_PRESENTATION }, - { u"STR_DELETING_SLIDES"_ustr, STR_DELETING_SLIDES }, - { u"STR_OPTIMIZING_GRAPHICS"_ustr, STR_OPTIMIZING_GRAPHICS }, - { u"STR_CREATING_OLE_REPLACEMENTS"_ustr,STR_CREATING_OLE_REPLACEMENTS }, - { u"STR_FileSizeSeparator"_ustr, STR_FILESIZESEPARATOR }, - { u"STR_FILENAME_SUFFIX"_ustr, STR_FILENAME_SUFFIX }, - { u"STR_WARN_UNSAVED_PRESENTATION"_ustr, STR_WARN_UNSAVED_PRESENTATION }, - { u"NotFound"_ustr, TK_NotFound } }; diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx b/sdext/source/minimizer/pppoptimizertoken.hxx index d3edfde40bae..4e2c29d0a2c3 100644 --- a/sdext/source/minimizer/pppoptimizertoken.hxx +++ b/sdext/source/minimizer/pppoptimizertoken.hxx @@ -59,31 +59,6 @@ enum PPPOptimizerTokenEnum TK_Status, TK_Pages, - STR_SUN_OPTIMIZATION_WIZARD2, - STR_INTRODUCTION, - STR_IMAGE_OPTIMIZATION, - STR_OLE_OBJECTS, - STR_OLE_OBJECTS_DESC, - STR_NO_OLE_OBJECTS_DESC, - STR_SLIDES, - STR_SUMMARY, - STR_DELETE_SLIDES, - STR_OPTIMIZE_IMAGES, - STR_CREATE_REPLACEMENT, - STR_MY_SETTINGS, - STR_OK, - STR_INFO_PRIMARY, - STR_INFO_SECONDARY_1, - STR_INFO_SECONDARY_2, - STR_INFO_SECONDARY_3, - STR_INFO_SECONDARY_4, - STR_DUPLICATING_PRESENTATION, - STR_DELETING_SLIDES, - STR_OPTIMIZING_GRAPHICS, - STR_CREATING_OLE_REPLACEMENTS, - STR_FILESIZESEPARATOR, - STR_FILENAME_SUFFIX, - STR_WARN_UNSAVED_PRESENTATION, TK_NotFound }; diff --git a/sdext/source/minimizer/sdextresid.cxx b/sdext/source/minimizer/sdextresid.cxx new file mode 100644 index 000000000000..c609b0e227ba --- /dev/null +++ b/sdext/source/minimizer/sdextresid.cxx @@ -0,0 +1,15 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include +#include + +OUString SdextResId(TranslateId aKey) { return Translate::get(aKey, Translate::Create("sdext")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */