summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2016-07-29 17:28:47 +0300
committerEike Rathke <erack@redhat.com>2016-07-29 21:33:06 +0000
commita3e57b44b26db382b7fe3004aa0211e26c07e6db (patch)
tree04e56dc7ebe39627a06eb92af10b553a06ec4cf5 /sc/source
parenta5fc27e0575eab115de3714ae07fcac7481f4daf (diff)
tdf#91665 l10n: Replace string list by separate strings in ScPrintUIOptions
String lists are sometimes (mis)used to group unrelated items; the advantage(?) being that only one identifier needs to be defined for the whole group. The items are then referenced by index, which is rather fragile when they are used in different parts of UI. String lists like this one should be replaced by separate strings. Change-Id: I78a2c8d1a8e5b1fed6a2d0afefd96ec126bb79af Reviewed-on: https://gerrit.libreoffice.org/27689 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/src/scstring.src61
-rw-r--r--sc/source/ui/unoobj/docuno.cxx25
2 files changed, 57 insertions, 29 deletions
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 2da99e27decb..fab1ebd259fb 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -703,21 +703,54 @@ String SCSTR_MOREBTN_FEWEROPTIONS
Text [ en-US ] = "Fewer ~Options";
};
-StringArray SCSTR_PRINT_OPTIONS
+String SCSTR_PRINTOPT_PAGES
{
- ItemList [en-US] =
- {
- < "Pages"; >;
- < "~Suppress output of empty pages"; >;
- < "Print content"; >;
- < "~All sheets"; >;
- < "~Selected sheets"; >;
- < "Selected cells"; >;
- < "From which print"; >;
- < "All ~pages"; >;
- < "Pa~ges"; >;
- < "%PRODUCTNAME %s"; >;
- };
+ Text [ en-US ] = "Pages";
+};
+
+String SCSTR_PRINTOPT_SUPPRESSEMPTY
+{
+ Text [ en-US ] = "~Suppress output of empty pages";
+};
+
+String SCSTR_PRINTOPT_PRNTCONTENT
+{
+ Text [ en-US ] = "Print content";
+};
+
+String SCSTR_PRINTOPT_ALLSHEETS
+{
+ Text [ en-US ] = "~All sheets";
+};
+
+String SCSTR_PRINTOPT_SELECTEDSHEETS
+{
+ Text [ en-US ] = "~Selected sheets";
+};
+
+String SCSTR_PRINTOPT_SELECTEDCELLS
+{
+ Text [ en-US ] = "Selected cells";
+};
+
+String SCSTR_PRINTOPT_FROMWHICH
+{
+ Text [ en-US ] = "From which print";
+};
+
+String SCSTR_PRINTOPT_ALLPAGES
+{
+ Text [ en-US ] = "All ~pages";
+};
+
+String SCSTR_PRINTOPT_PAGES_
+{
+ Text [ en-US ] = "Pa~ges";
+};
+
+String SCSTR_PRINTOPT_PRODNAME
+{
+ Text [ en-US ] = "%PRODUCTNAME %s";
};
String SCSTR_WARN_ME_IN_FUTURE_CHECK
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 4ce35d1c14c0..442ad4c8da20 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -242,11 +242,6 @@ ScPrintUIOptions::ScPrintUIOptions()
sal_Int32 nContent = rPrintOpt.GetAllSheets() ? 0 : 1;
bool bSuppress = rPrintOpt.GetSkipEmpty();
- ResStringArray aStrings( ScResId( SCSTR_PRINT_OPTIONS ) );
- OSL_ENSURE( aStrings.Count() >= 10, "resource incomplete" );
- if( aStrings.Count() < 10 ) // bad resource ?
- return;
-
sal_Int32 nNumProps= 9, nIdx = 0;
m_aUIProperties.resize(nNumProps);
@@ -257,34 +252,34 @@ ScPrintUIOptions::ScPrintUIOptions()
// create Section for spreadsheet (results in an extra tab page in dialog)
SvtModuleOptions aOpt;
- OUString aAppGroupname( aStrings.GetString( 9 ) );
+ OUString aAppGroupname( SC_RESSTR( SCSTR_PRINTOPT_PRODNAME ) );
aAppGroupname = aAppGroupname.replaceFirst( "%s", aOpt.GetModuleName( SvtModuleOptions::EModule::CALC ) );
m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, OUString());
// show subgroup for pages
- m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", OUString(aStrings.GetString(0)), OUString());
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", SC_RESSTR( SCSTR_PRINTOPT_PAGES ), OUString());
// create a bool option for empty pages
- m_aUIProperties[nIdx++].Value = setBoolControlOpt("suppressemptypages", OUString( aStrings.GetString( 1 ) ),
+ m_aUIProperties[nIdx++].Value = setBoolControlOpt("suppressemptypages", SC_RESSTR( SCSTR_PRINTOPT_SUPPRESSEMPTY ),
".HelpID:vcl:PrintDialog:IsSuppressEmptyPages:CheckBox",
"IsSuppressEmptyPages",
bSuppress);
// show Subgroup for print content
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = "PrintRange";
- m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("printrange", OUString(aStrings.GetString(2)),
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("printrange", SC_RESSTR( SCSTR_PRINTOPT_PRNTCONTENT ),
OUString(),
aPrintRangeOpt);
// create a choice for the content to create
uno::Sequence< OUString > aChoices( 3 ), aHelpIds( 3 ), aWidgetIds( 3 );
- aChoices[0] = aStrings.GetString( 3 );
+ aChoices[0] = SC_RESSTR( SCSTR_PRINTOPT_ALLSHEETS );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0";
aWidgetIds[0] = "printallsheets";
- aChoices[1] = aStrings.GetString( 4 );
+ aChoices[1] = SC_RESSTR( SCSTR_PRINTOPT_SELECTEDSHEETS );
aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1";
aWidgetIds[1] = "printselectedsheets";
- aChoices[2] = aStrings.GetString( 5 );
+ aChoices[2] = SC_RESSTR( SCSTR_PRINTOPT_SELECTEDCELLS );
aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2";
aWidgetIds[2] = "printselectedcells";
m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
@@ -293,7 +288,7 @@ ScPrintUIOptions::ScPrintUIOptions()
// show Subgroup for print range
aPrintRangeOpt.mbInternalOnly = true;
- m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("fromwhich", OUString(aStrings.GetString(6)),
+ m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("fromwhich", SC_RESSTR( SCSTR_PRINTOPT_FROMWHICH ),
OUString(),
aPrintRangeOpt);
@@ -302,10 +297,10 @@ ScPrintUIOptions::ScPrintUIOptions()
aChoices.realloc( 2 );
aHelpIds.realloc( 2 );
aWidgetIds.realloc( 2 );
- aChoices[0] = aStrings.GetString( 7 );
+ aChoices[0] = SC_RESSTR( SCSTR_PRINTOPT_ALLPAGES );
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0";
aWidgetIds[0] = "printallpages";
- aChoices[1] = aStrings.GetString( 8 );
+ aChoices[1] = SC_RESSTR( SCSTR_PRINTOPT_PAGES_ );
aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1";
aWidgetIds[1] = "printpages";
m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),