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 <andras.timar@collabora.com>
This commit is contained in:
Gabor Kelemen
2025-11-10 15:32:38 +01:00
committed by Andras Timar
parent 3de0caf523
commit f86a784f8f
17 changed files with 131 additions and 314 deletions
+1
View File
@@ -1214,6 +1214,7 @@ $(eval $(call gb_Helper_register_mos,\
sca \
scc \
sd \
sdext \
sfx \
shell \
sm \
@@ -18,87 +18,6 @@
-->
<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:package="org.openoffice.Office" oor:name="PresentationMinimizer">
<node oor:name="Strings">
<prop oor:name="STR_SUN_OPTIMIZATION_WIZARD2">
<value xml:lang="en-US">Presentation Minimizer</value>
</prop>
<prop oor:name="STR_INTRODUCTION">
<value xml:lang="en-US">Introduction</value>
</prop>
<prop oor:name="STR_IMAGE_OPTIMIZATION">
<value xml:lang="en-US">Images</value>
</prop>
<prop oor:name="STR_OLE_OBJECTS">
<value xml:lang="en-US">OLE Objects</value>
</prop>
<prop oor:name="STR_OLE_OBJECTS_DESC">
<value xml:lang="en-US">Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.
The current presentation contains OLE objects.</value>
</prop>
<prop oor:name="STR_NO_OLE_OBJECTS_DESC">
<value xml:lang="en-US">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.</value>
</prop>
<prop oor:name="STR_SLIDES">
<value xml:lang="en-US">Slides</value>
</prop>
<prop oor:name="STR_SUMMARY">
<value xml:lang="en-US">Summary</value>
</prop>
<prop oor:name="STR_DELETE_SLIDES">
<value xml:lang="en-US">Delete %SLIDES slides.</value>
</prop>
<prop oor:name="STR_OPTIMIZE_IMAGES">
<value xml:lang="en-US">Optimize %IMAGES images to %QUALITY% JPEG quality at %RESOLUTION DPI.</value>
</prop>
<prop oor:name="STR_CREATE_REPLACEMENT">
<value xml:lang="en-US">Create replacement images for %OLE objects.</value>
</prop>
<prop oor:name="MY_SETTINGS">
<value xml:lang="en-US">My Settings </value>
</prop>
<prop oor:name="STR_OK">
<value xml:lang="en-US">OK</value>
</prop>
<prop oor:name="STR_INFO_PRIMARY">
<value xml:lang="en-US">Successfully updated the presentation “%TITLE”.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_1">
<value xml:lang="en-US">The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_2">
<value xml:lang="en-US">The file size has changed from %OLDFILESIZE MB to approximately %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_3">
<value xml:lang="en-US">The file size has changed to %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_4">
<value xml:lang="en-US">The file size has changed to approximately %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_DUPLICATING_PRESENTATION">
<value xml:lang="en-US">Duplicating presentation...</value>
</prop>
<prop oor:name="STR_DELETING_SLIDES">
<value xml:lang="en-US">Deleting slides...</value>
</prop>
<prop oor:name="STR_OPTIMIZING_GRAPHICS">
<value xml:lang="en-US">Optimizing images...</value>
</prop>
<prop oor:name="STR_CREATING_OLE_REPLACEMENTS">
<value xml:lang="en-US">Creating replacement images for OLE objects...</value>
</prop>
<prop oor:name="STR_FILESIZESEPARATOR">
<value xml:lang="en-US">.</value>
</prop>
<prop oor:name="STR_FILENAME_SUFFIX">
<value xml:lang="en-US">(minimized)</value>
</prop>
<prop oor:name="STR_WARN_UNSAVED_PRESENTATION">
<value xml:lang="en-US">Do you want to minimize presentation without saving?</value>
</prop>
</node>
<node oor:name="LastUsedSettings">
<prop oor:name="Name">
<value xml:lang="en-US">Projector optimized</value>
@@ -123,115 +123,6 @@
</group>
</templates>
<component>
<group oor:name="Strings">
<info><desc>UI strings.</desc></info>
<prop oor:name="STR_SUN_OPTIMIZATION_WIZARD2" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_SUN_OPTIMIZATION_WIZARD2</desc></info>
<value>Presentation Minimizer</value>
</prop>
<prop oor:name="STR_INTRODUCTION" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INTRODUCTION.</desc></info>
<value>Introduction</value>
</prop>
<prop oor:name="STR_IMAGE_OPTIMIZATION" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_IMAGE_OPTIMIZATION.</desc></info>
<value>Images</value>
</prop>
<prop oor:name="STR_OLE_OBJECTS" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_OLE_OBJECTS.</desc></info>
<value>OLE Objects</value>
</prop>
<prop oor:name="STR_OLE_OBJECTS_DESC" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_OLE_OBJECTS_DESC.</desc></info>
<value>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.</value>
</prop>
<prop oor:name="STR_NO_OLE_OBJECTS_DESC" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_NO_OLE_OBJECTS_DESC.</desc></info>
<value>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.</value>
</prop>
<prop oor:name="STR_SLIDES" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_SLIDES.</desc></info>
<value>Slides</value>
</prop>
<prop oor:name="STR_SUMMARY" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_SUMMARY.</desc></info>
<value>Summary</value>
</prop>
<prop oor:name="STR_DELETE_SLIDES" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_DELETE_SLIDES.</desc></info>
<value>Delete %SLIDES slides</value>
</prop>
<prop oor:name="STR_OPTIMIZE_IMAGES" oor:type="xs:string" oor:localized="true">
<info>
<desc>The following string is only used in plural.</desc>
</info>
<value>Optimize %IMAGES images to %QUALITY% JPEG quality at %RESOLUTION DPI.</value>
</prop>
<prop oor:name="STR_CREATE_REPLACEMENT" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_CREATE_REPLACEMENT.</desc></info>
<value>Create replacement images for %OLE objects.</value>
</prop>
<prop oor:name="MY_SETTINGS" oor:type="xs:string" oor:localized="true">
<info><desc>String MY_SETTINGS.</desc></info>
<value>My Settings</value>
</prop>
<prop oor:name="STR_OK" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_OK.</desc></info>
<value>OK</value>
</prop>
<prop oor:name="STR_INFO_PRIMARY" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INFO_SECONDARY_1.</desc></info>
<value>The Presentation Minimizer has successfully updated the presentation '%TITLE'.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_1" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INFO_SECONDARY_1.</desc></info>
<value>The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_2" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INFO_SECONDARY_2.</desc></info>
<value>The file size has changed from %OLDFILESIZE MB to approximately %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_3" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INFO_SECONDARY_3.</desc></info>
<value>The file size has changed to %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_INFO_SECONDARY_4" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_INFO_SECONDARY_4.</desc></info>
<value>The file size has changed to approximately %NEWFILESIZE MB.</value>
</prop>
<prop oor:name="STR_DUPLICATING_PRESENTATION" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_DUPLICATING_PRESENTATION.</desc></info>
<value>Duplicating presentation...</value>
</prop>
<prop oor:name="STR_DELETING_SLIDES" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_DELETING_SLIDES.</desc></info>
<value>Deleting slides...</value>
</prop>
<prop oor:name="STR_OPTIMIZING_GRAPHICS" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_OPTIMIZING_GRAPHICS.</desc></info>
<value>Optimizing images...</value>
</prop>
<prop oor:name="STR_CREATING_OLE_REPLACEMENTS" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_CREATING_OLE_REPLACEMENTS.</desc></info>
<value>Creating replacement images for OLE objects...</value>
</prop>
<prop oor:name="STR_FILESIZESEPARATOR" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_FILESIZESEPARATOR.</desc></info>
<value>.</value>
</prop>
<prop oor:name="STR_FILENAME_SUFFIX" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_FILENAME_SUFFIX.</desc></info>
<value>(minimized)</value>
</prop>
<prop oor:name="STR_WARN_UNSAVED_PRESENTATION" oor:type="xs:string" oor:localized="true">
<info><desc>String STR_WARN_UNSAVED_PRESENTATION.</desc></info>
<value>Do you want to minimize presentation without saving?</value>
</prop>
</group>
<node-ref oor:name="LastUsedSettings" oor:node-type="OptimizerSettings">
<info>
<desc>describes the name of the last used settings</desc>
+14
View File
@@ -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:
+2
View File
@@ -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:
+4
View File
@@ -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 \
+16
View File
@@ -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 <unotools/resmgr.hxx>
OUString SdextResId(TranslateId aKey);
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+41
View File
@@ -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: */
@@ -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
@@ -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 );
+9 -7
View File
@@ -19,10 +19,12 @@
#include "impoptimizer.hxx"
#include <sdextresid.hxx>
#include "pppoptimizer.hxx"
#include "graphiccollector.hxx"
#include "pagecollector.hxx"
#include "informationdialog.hxx"
#include <strings.hrc>
#include <vector>
#include <com/sun/star/util/URL.hpp>
@@ -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 );
+10 -8
View File
@@ -19,6 +19,8 @@
#include "informationdialog.hxx"
#include <sdextresid.hxx>
#include <strings.hrc>
#include <com/sun/star/awt/PushButtonType.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/util/URL.hpp>
@@ -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
+11 -9
View File
@@ -21,6 +21,7 @@
#include "optimizerdialog.hxx"
#include "impoptimizer.hxx"
#include "fileopendialog.hxx"
#include <sdextresid.hxx>
#include <com/sun/star/awt/XItemEventBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
@@ -43,6 +44,7 @@
#include <tools/urlobj.hxx>
#include <o3tl/string_view.hxx>
#include <bitmaps.hlst>
#include <strings.hrc>
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<weld::MessageDialog> 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
@@ -19,6 +19,8 @@
#include "optimizerdialog.hxx"
#include <sdextresid.hxx>
#include <strings.hrc>
#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<OptimizerSettings>::size_type i;
const std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
@@ -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 }
};
@@ -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
};
+15
View File
@@ -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 <sdextresid.hxx>
#include <unotools/resmgr.hxx>
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: */