summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
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 /sc/source/ui/view
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 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/cellsh1.cxx14
-rw-r--r--sc/source/ui/view/dbfunc3.cxx28
-rw-r--r--sc/source/ui/view/drawvie3.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx1
-rw-r--r--sc/source/ui/view/gridwin.cxx1
-rw-r--r--sc/source/ui/view/gridwin2.cxx1
-rw-r--r--sc/source/ui/view/olinewin.cxx2
-rw-r--r--sc/source/ui/view/reffact.cxx1
-rw-r--r--sc/source/ui/view/tabview2.cxx10
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx1
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx1
-rw-r--r--sc/source/ui/view/tabvwsha.cxx20
-rw-r--r--sc/source/ui/view/tabvwshc.cxx1
-rw-r--r--sc/source/ui/view/tabvwshf.cxx1
-rw-r--r--sc/source/ui/view/viewfunc.cxx15
15 files changed, 54 insertions, 45 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 1ffb68bcb209..c576d27c8cad 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2844,7 +2844,7 @@ void ScCellShell::ExecuteDataPilotDialog()
}
else // create new table
{
- sal_uLong nSrcErrorId = 0;
+ const char* pSrcErrorId = nullptr;
// select database range or data
pTabViewShell->GetDBData( true, SC_DB_OLD );
@@ -2921,8 +2921,8 @@ void ScCellShell::ExecuteDataPilotDialog()
OUString aName = pTypeDlg->GetSelectedNamedRange();
ScSheetSourceDesc aShtDesc(pDoc);
aShtDesc.SetRangeName(aName);
- nSrcErrorId = aShtDesc.CheckSourceRange();
- if (!nSrcErrorId)
+ pSrcErrorId = aShtDesc.CheckSourceRange();
+ if (!pSrcErrorId)
{
pNewDPObject.reset(new ScDPObject(pDoc));
pNewDPObject->SetSheetDesc(aShtDesc);
@@ -2963,8 +2963,8 @@ void ScCellShell::ExecuteDataPilotDialog()
{
ScSheetSourceDesc aShtDesc(pDoc);
aShtDesc.SetSourceRange(aRange);
- nSrcErrorId = aShtDesc.CheckSourceRange();
- if (!nSrcErrorId)
+ pSrcErrorId = aShtDesc.CheckSourceRange();
+ if (!pSrcErrorId)
{
pNewDPObject.reset(new ScDPObject(pDoc));
pNewDPObject->SetSheetDesc( aShtDesc );
@@ -2980,10 +2980,10 @@ void ScCellShell::ExecuteDataPilotDialog()
}
}
- if (nSrcErrorId)
+ if (pSrcErrorId)
{
// Error occurred during data creation. Launch an error and bail out.
- ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
+ ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(pSrcErrorId));
aBox->Execute();
return;
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 51f028f5503d..c0b91e6d1056 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1328,7 +1328,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
return;
}
- sal_uInt16 nErrorId = 0;
+ const char* pErrorId = nullptr;
pDPObj->BuildAllDimensionMembers();
ScDPSaveData aData( *pDPObj->GetSaveData() );
@@ -1359,7 +1359,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
}
else if (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW)
@@ -1382,10 +1382,10 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
}
}
@@ -1408,10 +1408,10 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
}
else
@@ -1455,7 +1455,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
}
else if (aPosData.Flags & MemberResultFlags::GRANDTOTAL)
@@ -1481,7 +1481,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
if (rString.isEmpty())
{
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
break;
}
@@ -1496,7 +1496,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
while (false);
}
@@ -1554,10 +1554,10 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bChange = true;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
else
- nErrorId = STR_INVALIDNAME;
+ pErrorId = STR_INVALIDNAME;
}
}
while (false);
@@ -1575,9 +1575,9 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
}
else
{
- if ( !nErrorId )
- nErrorId = STR_ERR_DATAPILOT_INPUT;
- ErrorMessage( nErrorId );
+ if (!pErrorId)
+ pErrorId = STR_ERR_DATAPILOT_INPUT;
+ ErrorMessage(pErrorId);
}
}
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index daf4666a15ab..3a541afe5530 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -22,7 +22,7 @@
#include <sfx2/app.hxx>
#include <sfx2/viewfrm.hxx>
-#include "scres.hrc"
+#include "strings.hrc"
#include "scresid.hxx"
#include "drawview.hxx"
#include "drwlayer.hxx"
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 8475c7c400e0..01007fc205d3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -60,6 +60,7 @@
#include "formatsh.hxx"
#include "sc.hrc"
+#include "scres.hrc"
#include "globstr.hrc"
#include "docsh.hxx"
#include "patattr.hxx"
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6725ffb5ef8c..b37b6d1f2e99 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -83,6 +83,7 @@
#include "cbutton.hxx"
#include "sc.hrc"
#include "globstr.hrc"
+#include "strings.hrc"
#include "editutil.hxx"
#include "scresid.hxx"
#include "inputhdl.hxx"
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 632ef881a1d4..e5d007bc8d71 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -31,6 +31,7 @@
#include "scresid.hxx"
#include "sc.hrc"
#include "globstr.hrc"
+#include "strings.hrc"
#include "pagedata.hxx"
#include "dpobject.hxx"
#include "dpsave.hxx"
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 6e1d9174dd4d..63851cff97a0 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -25,7 +25,7 @@
#include "olinetab.hxx"
#include "document.hxx"
#include "dbfunc.hxx"
-#include "scres.hrc"
+#include "strings.hrc"
#include "scresid.hxx"
#include "bitmaps.hlst"
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index d843cb50fbcc..9be4c1747916 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -29,6 +29,7 @@
#include "acredlin.hxx"
#include "simpref.hxx"
#include "scmod.hxx"
+#include "scres.hrc"
#include "validate.hxx"
SFX_IMPL_MODELESSDIALOG_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME )
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 84f6babcb0d3..84f19b96ff46 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1414,7 +1414,7 @@ void ScTabView::MakeDrawLayer()
}
}
-void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
+void ScTabView::ErrorMessage(const char* pGlobStrId)
{
if ( SC_MOD()->IsInExecuteDrop() )
{
@@ -1428,15 +1428,15 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
ScWaitCursorOff aWaitOff( pParent );
bool bFocus = pParent && pParent->HasFocus();
- if(nGlobStrId==STR_PROTECTIONERR)
+ if (pGlobStrId && strcmp(pGlobStrId, STR_PROTECTIONERR) == 0)
{
- if(aViewData.GetDocShell()->IsReadOnly())
+ if (aViewData.GetDocShell()->IsReadOnly())
{
- nGlobStrId=STR_READONLYERR;
+ pGlobStrId = STR_READONLYERR;
}
}
- ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
+ ScopedVclPtrInstance<InfoBox> aBox(pParent, ScGlobal::GetRscString(pGlobStrId));
aBox->Execute();
if (bFocus)
pParent->GrabFocus();
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 559aa45506bc..f477bf941440 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -34,6 +34,7 @@
#include <vcl/vclenum.hxx>
#include "globstr.hrc"
+#include "strings.hrc"
#include "scmod.hxx"
#include "appoptio.hxx"
#include "tabvwsh.hxx"
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index c43b968b7ab5..4401d7cc57c0 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -23,6 +23,7 @@
#include <editeng/eeitem.hxx>
#include <sfx2/app.hxx>
+#include <svx/dialogs.hrc>
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
#include <editeng/boxitem.hxx>
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 8320d32aabb4..49754e374a06 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -87,30 +87,30 @@ bool ScTabViewShell::GetFunction( OUString& rFuncStr, FormulaError nErrCode )
return true;
}
- sal_uInt16 nGlobStrId = 0;
+ const char* pGlobStrId = nullptr;
switch (eFunc)
{
- case SUBTOTAL_FUNC_AVE: nGlobStrId = STR_FUN_TEXT_AVG; break;
- case SUBTOTAL_FUNC_CNT: nGlobStrId = STR_FUN_TEXT_COUNT; break;
- case SUBTOTAL_FUNC_CNT2: nGlobStrId = STR_FUN_TEXT_COUNT2; break;
- case SUBTOTAL_FUNC_MAX: nGlobStrId = STR_FUN_TEXT_MAX; break;
- case SUBTOTAL_FUNC_MIN: nGlobStrId = STR_FUN_TEXT_MIN; break;
- case SUBTOTAL_FUNC_SUM: nGlobStrId = STR_FUN_TEXT_SUM; break;
- case SUBTOTAL_FUNC_SELECTION_COUNT: nGlobStrId = STR_FUN_TEXT_SELECTION_COUNT; break;
+ case SUBTOTAL_FUNC_AVE: pGlobStrId = STR_FUN_TEXT_AVG; break;
+ case SUBTOTAL_FUNC_CNT: pGlobStrId = STR_FUN_TEXT_COUNT; break;
+ case SUBTOTAL_FUNC_CNT2: pGlobStrId = STR_FUN_TEXT_COUNT2; break;
+ case SUBTOTAL_FUNC_MAX: pGlobStrId = STR_FUN_TEXT_MAX; break;
+ case SUBTOTAL_FUNC_MIN: pGlobStrId = STR_FUN_TEXT_MIN; break;
+ case SUBTOTAL_FUNC_SUM: pGlobStrId = STR_FUN_TEXT_SUM; break;
+ case SUBTOTAL_FUNC_SELECTION_COUNT: pGlobStrId = STR_FUN_TEXT_SELECTION_COUNT; break;
default:
{
// added to avoid warnings
}
}
- if (nGlobStrId)
+ if (pGlobStrId)
{
ScDocument* pDoc = rViewData.GetDocument();
SCCOL nPosX = rViewData.GetCurX();
SCROW nPosY = rViewData.GetCurY();
SCTAB nTab = rViewData.GetTabNo();
- aStr = ScGlobal::GetRscString(nGlobStrId);
+ aStr = ScGlobal::GetRscString(pGlobStrId);
aStr += ": ";
ScAddress aCursor( nPosX, nPosY, nTab );
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 53ad7ede5038..a2df0116562f 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -28,6 +28,7 @@
#include "tabvwsh.hxx"
#include "sc.hrc"
+#include "scres.hrc"
#include "globstr.hrc"
#include "global.hxx"
#include "scmod.hxx"
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 5a2449cca069..ad32a62964d8 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -41,6 +41,7 @@
#include "shtabdlg.hxx"
#include "scresid.hxx"
#include "globstr.hrc"
+#include "strings.hrc"
#include "docfunc.hxx"
#include "eventuno.hxx"
#include "dpobject.hxx"
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index d287ba5fe63f..8175d3b767de 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -47,7 +47,8 @@
#include "patattr.hxx"
#include "docpool.hxx"
#include "uiitems.hxx"
-#include "scres.hrc"
+#include "sc.hrc"
+#include "strings.hrc"
#include "undocell.hxx"
#include "undoblk.hxx"
#include "undotab.hxx"
@@ -1611,9 +1612,9 @@ void ScViewFunc::DeleteMulti( bool bRows )
// test if allowed
- sal_uInt16 nErrorId = 0;
+ const char* pErrorId = nullptr;
bool bNeedRefresh = false;
- for (size_t i = 0, n = aSpans.size(); i < n && !nErrorId; ++i)
+ for (size_t i = 0, n = aSpans.size(); i < n && !pErrorId; ++i)
{
SCCOLROW nStart = aSpans[i].mnStart;
SCCOLROW nEnd = aSpans[i].mnEnd;
@@ -1641,7 +1642,7 @@ void ScViewFunc::DeleteMulti( bool bRows )
// test to the end of the sheet
ScEditableTester aTester( &rDoc, nTab, nStartCol, nStartRow, MAXCOL, MAXROW );
if (!aTester.IsEditable())
- nErrorId = aTester.GetMessageId();
+ pErrorId = aTester.GetMessageId();
}
// merged cells
@@ -1657,7 +1658,7 @@ void ScViewFunc::DeleteMulti( bool bRows )
// Disallow deleting parts of a merged cell.
// Deleting the start is allowed (merge is removed), so the end doesn't have to be checked.
- nErrorId = STR_MSSG_DELETECELLS_0;
+ pErrorId = STR_MSSG_DELETECELLS_0;
}
if ( nMergeEndX != nEndCol || nMergeEndY != nEndRow )
{
@@ -1667,9 +1668,9 @@ void ScViewFunc::DeleteMulti( bool bRows )
}
}
- if ( nErrorId )
+ if (pErrorId)
{
- ErrorMessage( nErrorId );
+ ErrorMessage(pErrorId);
return;
}