summaryrefslogtreecommitdiff
path: root/filter/source
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 /filter/source
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 'filter/source')
-rw-r--r--filter/source/flash/impswfdialog.hxx1
-rw-r--r--filter/source/flash/swfdialog.hxx1
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx12
-rw-r--r--filter/source/graphicfilter/eps/epsstr.src27
-rw-r--r--filter/source/graphicfilter/eps/strings.hrc22
-rw-r--r--filter/source/pdf/impdialog.cxx23
-rw-r--r--filter/source/pdf/impdialog.hrc45
-rw-r--r--filter/source/pdf/impdialog.hxx9
-rw-r--r--filter/source/pdf/impdialog.src91
-rw-r--r--filter/source/pdf/pdf.hrc22
-rw-r--r--filter/source/pdf/pdf.src27
-rw-r--r--filter/source/pdf/pdfexport.cxx16
-rw-r--r--filter/source/svg/impsvgdialog.hxx3
-rw-r--r--filter/source/svg/svgdialog.hxx2
-rw-r--r--filter/source/t602/t602filter.cxx23
-rw-r--r--filter/source/t602/t602filter.hrc39
-rw-r--r--filter/source/t602/t602filter.hxx7
-rw-r--r--filter/source/t602/t602filter.src77
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogstrings.hrc55
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogstrings.src132
-rw-r--r--filter/source/xsltdialog/xmlfilterjar.cxx2
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx32
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hxx12
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.cxx37
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.hxx5
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagebasic.cxx2
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagebasic.hxx1
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagexslt.hxx1
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.cxx2
29 files changed, 85 insertions, 643 deletions
diff --git a/filter/source/flash/impswfdialog.hxx b/filter/source/flash/impswfdialog.hxx
index adf3a349f715..5dfe84de0d13 100644
--- a/filter/source/flash/impswfdialog.hxx
+++ b/filter/source/flash/impswfdialog.hxx
@@ -31,7 +31,6 @@
#include <vcl/FilterConfigItem.hxx>
-class ResMgr;
namespace vcl { class Window; }
diff --git a/filter/source/flash/swfdialog.hxx b/filter/source/flash/swfdialog.hxx
index c659b51750cd..e75d8ba08a87 100644
--- a/filter/source/flash/swfdialog.hxx
+++ b/filter/source/flash/swfdialog.hxx
@@ -27,7 +27,6 @@
namespace vcl { class Window; }
-class ResMgr;
class SWFDialog final:
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index a8bfd98c4410..f84093afa558 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -21,6 +21,7 @@
#include <tools/stream.hxx>
#include <tools/poly.hxx>
#include <tools/fract.hxx>
+#include <tools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/metaact.hxx>
#include <vcl/graph.hxx>
@@ -436,14 +437,9 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
if ( mbStatus && mnLevelWarning && pFilterConfigItem )
{
- ResMgr* pResMgr;
- pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
- if( pResMgr )
- {
- ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, ResId(KEY_VERSION_CHECK, *pResMgr) );
- aInfoBox->Execute();
- delete pResMgr;
- }
+ std::locale loc = Translate::Create("flt", Application::GetSettings().GetUILanguageTag());
+ ScopedVclPtrInstance< InfoBox > aInfoBox(nullptr, Translate::get(KEY_VERSION_CHECK, loc));
+ aInfoBox->Execute();
}
if ( xStatusIndicator.is() )
diff --git a/filter/source/graphicfilter/eps/epsstr.src b/filter/source/graphicfilter/eps/epsstr.src
deleted file mode 100644
index 2a1139514450..000000000000
--- a/filter/source/graphicfilter/eps/epsstr.src
+++ /dev/null
@@ -1,27 +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 "strings.hrc"
-
-String KEY_VERSION_CHECK
-{
- Text [ en-US ] = "Warning: Not all of the imported EPS graphics could be saved at level1\nas some are at a higher level!";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eps/strings.hrc b/filter/source/graphicfilter/eps/strings.hrc
deleted file mode 100644
index 531cc7d7c4cb..000000000000
--- a/filter/source/graphicfilter/eps/strings.hrc
+++ /dev/null
@@ -1,22 +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 .
- */
-
-#define KEY_VERSION_CHECK 260
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index e509e43e867a..56e3370158e0 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -20,7 +20,7 @@
#include <string.h>
#include "impdialog.hxx"
-#include "impdialog.hrc"
+#include "strings.hrc"
#include "bitmaps.hlst"
#include <officecfg/Office/Common.hxx>
#include <vcl/layout.hxx>
@@ -28,6 +28,7 @@
#include <vcl/svapp.hxx>
#include "sfx2/passwd.hxx"
#include "svtools/miscopt.hxx"
+#include "tools/resmgr.hxx"
#include "comphelper/propertyvalue.hxx"
#include "comphelper/sequence.hxx"
@@ -41,17 +42,17 @@
#include "com/sun/star/security/DocumentDigitalSignatures.hpp"
#include "com/sun/star/security/XCertificate.hpp"
-static ResMgr& getPDFFilterResMgr()
+static std::locale& getPDFFilterResLocale()
{
- static ResMgr *pRes = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag());
- return *pRes;
+ static std::locale loc = Translate::Create("flt", Application::GetSettings().GetUILanguageTag());
+ return loc;
}
-PDFFilterResId::PDFFilterResId( sal_uInt32 nId ) : ResId( nId, getPDFFilterResMgr() )
+OUString PDFFilterResId(const char* pId)
{
+ return Translate::get(pId, getPDFFilterResLocale());
}
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1613,35 +1614,35 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
{
case vcl::PDFWriter::Warning_Transparency_Omitted_PDFA:
{
- sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_WARN_TRANSP_PDFA_SHORT ) ),
+ sal_uInt16 nPos = m_pErrors->InsertEntry( PDFFilterResId( STR_WARN_TRANSP_PDFA_SHORT ),
aWarnImg );
m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_WARN_TRANSP_PDFA ) ) );
}
break;
case vcl::PDFWriter::Warning_Transparency_Omitted_PDF13:
{
- sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_WARN_TRANSP_VERSION_SHORT ) ),
+ sal_uInt16 nPos = m_pErrors->InsertEntry( PDFFilterResId( STR_WARN_TRANSP_VERSION_SHORT ),
aWarnImg );
m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_WARN_TRANSP_VERSION ) ) );
}
break;
case vcl::PDFWriter::Warning_FormAction_Omitted_PDFA:
{
- sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_WARN_FORMACTION_PDFA_SHORT ) ),
+ sal_uInt16 nPos = m_pErrors->InsertEntry( PDFFilterResId( STR_WARN_FORMACTION_PDFA_SHORT ),
aWarnImg );
m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_WARN_FORMACTION_PDFA ) ) );
}
break;
case vcl::PDFWriter::Warning_Transparency_Converted:
{
- sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_WARN_TRANSP_CONVERTED_SHORT ) ),
+ sal_uInt16 nPos = m_pErrors->InsertEntry( PDFFilterResId( STR_WARN_TRANSP_CONVERTED_SHORT ),
aWarnImg );
m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_WARN_TRANSP_CONVERTED ) ) );
}
break;
case vcl::PDFWriter::Error_Signature_Failed:
{
- sal_uInt16 nPos = m_pErrors->InsertEntry( OUString( PDFFilterResId( STR_ERR_SIGNATURE_FAILED ) ),
+ sal_uInt16 nPos = m_pErrors->InsertEntry( PDFFilterResId( STR_ERR_SIGNATURE_FAILED ),
aErrImg );
m_pErrors->SetEntryData( nPos, new OUString( PDFFilterResId( STR_ERR_PDF_EXPORT_ABORTED ) ) );
}
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
deleted file mode 100644
index cd9f7772cb8b..000000000000
--- a/filter/source/pdf/impdialog.hrc
+++ /dev/null
@@ -1,45 +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 <filter.hrc>
-
-#define STR_ERR_SIGNATURE_FAILED (RID_PDF_DIALOG_START + 0)
-#define STR_ERR_PDF_EXPORT_ABORTED (RID_PDF_DIALOG_START + 1)
-
-#define STR_WARN_PASSWORD_PDFA (RID_PDF_DIALOG_START + 6)
-
-//strings for PDF security, user password management
-#define STR_PDF_EXPORT_UDPWD (RID_PDF_DIALOG_START + 7)
-
-//strings for PDF security, owner password management
-#define STR_PDF_EXPORT_ODPWD (RID_PDF_DIALOG_START + 8)
-
-#define STR_WARN_TRANSP_PDFA (RID_PDF_DIALOG_START + 9)
-#define STR_WARN_TRANSP_PDFA_SHORT (RID_PDF_DIALOG_START + 10)
-#define STR_WARN_TRANSP_VERSION (RID_PDF_DIALOG_START + 11)
-#define STR_WARN_TRANSP_VERSION_SHORT (RID_PDF_DIALOG_START + 12)
-#define STR_WARN_FORMACTION_PDFA (RID_PDF_DIALOG_START + 13)
-#define STR_WARN_FORMACTION_PDFA_SHORT (RID_PDF_DIALOG_START + 14)
-#define STR_WARN_TRANSP_CONVERTED (RID_PDF_DIALOG_START + 15)
-#define STR_WARN_TRANSP_CONVERTED_SHORT (RID_PDF_DIALOG_START + 16)
-
-//ATTENTION: maximum allowed value is (RID_PDF_DIALOG_START + 19)
-//(see filter/inc/filter.hrc)
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 2def0c7ffd83..526fa0cdf96f 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -38,20 +38,11 @@
#include <com/sun/star/beans/NamedValue.hpp>
-
class ImpPDFTabGeneralPage;
class ImpPDFTabViewerPage;
class ImpPDFTabOpnFtrPage;
class ImpPDFTabLinksPage;
-
-class PDFFilterResId : public ResId
-{
-public:
- explicit PDFFilterResId( sal_uInt32 nId );
-};
-
-
class ImplErrorDialog : public MessageDialog
{
private:
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
deleted file mode 100644
index cb5b68a61ae8..000000000000
--- a/filter/source/pdf/impdialog.src
+++ /dev/null
@@ -1,91 +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 "impdialog.hrc"
-
-//strings used in encryption UI
-
-//password dialog title
-String STR_PDF_EXPORT_UDPWD
-{
- Text[ en-US ] = "Set open password";
-};
-
-//password dialog title
-String STR_PDF_EXPORT_ODPWD
-{
- Text[ en-US ] = "Set permission password";
-};
-
-String STR_WARN_PASSWORD_PDFA
-{
- Text [ en-US ] = "PDF/A does not allow encryption. The exported PDF file will not be password protected.";
-};
-
-String STR_WARN_TRANSP_PDFA_SHORT
-{
- Text [en-US] = "PDF/A transparency";
-};
-
-String STR_WARN_TRANSP_PDFA
-{
- Text [en-US] = "PDF/A forbids transparency. A transparent object was painted opaque instead.";
-};
-
-String STR_WARN_TRANSP_VERSION_SHORT
-{
- Text [en-US] = "PDF version conflict";
-};
-
-String STR_WARN_TRANSP_VERSION
-{
- Text [en-US] = "Transparency is not supported in PDF versions earlier than PDF 1.4. A transparent object was painted opaque instead";
-};
-
-String STR_WARN_FORMACTION_PDFA_SHORT
-{
- Text [en-US] = "PDF/A form action";
-};
-
-String STR_WARN_FORMACTION_PDFA
-{
- Text [en-US] = "A form control contained an action not supported by the PDF/A standard. The action was skipped";
-};
-
-String STR_WARN_TRANSP_CONVERTED
-{
- Text [en-US] = "Some objects were converted to an image in order to remove transparencies, because the target PDF format does not support transparencies. Possibly better results can be achieved if you remove the transparent objects before exporting.";
-};
-
-String STR_WARN_TRANSP_CONVERTED_SHORT
-{
- Text [en-US] = "Transparencies removed";
-};
-
-String STR_ERR_SIGNATURE_FAILED
-{
- Text [en-US] = "Signature generation failed";
-};
-
-String STR_ERR_PDF_EXPORT_ABORTED
-{
- Text [en-US] = "PDF export aborted";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/pdf.hrc b/filter/source/pdf/pdf.hrc
deleted file mode 100644
index 64b4dab38afc..000000000000
--- a/filter/source/pdf/pdf.hrc
+++ /dev/null
@@ -1,22 +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 .
- */
-
-#define PDF_PROGRESS_BAR 260
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/pdf.src b/filter/source/pdf/pdf.src
deleted file mode 100644
index bf491d31856c..000000000000
--- a/filter/source/pdf/pdf.src
+++ /dev/null
@@ -1,27 +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 "pdf.hrc"
-
-String PDF_PROGRESS_BAR
-{
- Text [ en-US ] = "Export as PDF";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 1d24b3e0bf5e..d260e0308d59 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -22,6 +22,7 @@
#include <tools/urlobj.hxx>
#include <tools/fract.hxx>
#include <tools/poly.hxx>
+#include <tools/resmgr.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/virdev.hxx>
#include <vcl/metaact.hxx>
@@ -50,7 +51,7 @@
#include "pdfexport.hxx"
#include "impdialog.hxx"
-#include "pdf.hrc"
+#include "strings.hrc"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -883,14 +884,11 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
if ( mxStatusIndicator.is() )
{
- std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag() ));
- if ( pResMgr )
- {
- sal_Int32 nTotalPageCount = aRangeEnum.size();
- if ( bExportPages && bExportNotesPages )
- nTotalPageCount *= 2;
- mxStatusIndicator->start( ResId( PDF_PROGRESS_BAR, *pResMgr ), nTotalPageCount );
- }
+ std::locale loc(Translate::Create("flt", Application::GetSettings().GetUILanguageTag()));
+ sal_Int32 nTotalPageCount = aRangeEnum.size();
+ if ( bExportPages && bExportNotesPages )
+ nTotalPageCount *= 2;
+ mxStatusIndicator->start(Translate::get(PDF_PROGRESS_BAR, loc), nTotalPageCount);
}
bRet = nPageCount > 0;
diff --git a/filter/source/svg/impsvgdialog.hxx b/filter/source/svg/impsvgdialog.hxx
index 205a3417e118..0e31fc33bef1 100644
--- a/filter/source/svg/impsvgdialog.hxx
+++ b/filter/source/svg/impsvgdialog.hxx
@@ -37,7 +37,6 @@
#define SVG_PROP_POSITIONED_CHARACTERS "UsePositionedCharacters"
-class ResMgr;
namespace vcl { class Window; }
@@ -61,7 +60,7 @@ private:
public:
- ImpSVGDialog( vcl::Window* pParent, /*ResMgr& rResMgr,*/
+ ImpSVGDialog( vcl::Window* pParent,
css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
virtual ~ImpSVGDialog() override;
virtual void dispose() override;
diff --git a/filter/source/svg/svgdialog.hxx b/filter/source/svg/svgdialog.hxx
index 812e6efa9a5f..92d3d0432938 100644
--- a/filter/source/svg/svgdialog.hxx
+++ b/filter/source/svg/svgdialog.hxx
@@ -28,8 +28,6 @@
#include <memory>
-class ResMgr;
-
class SVGDialog final:
public ::svt::OGenericUnoDialog,
public ::comphelper::OPropertyArrayUsageHelper< SVGDialog >,
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index b5cebf5ec5fd..ea20785d4995 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -18,7 +18,7 @@
*/
#include "t602filter.hxx"
-#include "t602filter.hrc"
+#include "strings.hrc"
#include <stdio.h>
@@ -35,8 +35,10 @@
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XDialog.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <osl/diagnose.h>
#include <rtl/ref.hxx>
#include <rtl/character.hxx>
+#include <tools/resmgr.hxx>
#include <unotools/streamwrap.hxx>
using namespace ::cppu;
@@ -883,8 +885,10 @@ Reference< XInterface > SAL_CALL T602ImportFilter_createInstance( const Referenc
return static_cast<cppu::OWeakObject*>(new T602ImportFilter( rSMgr ));
}
-T602ImportFilterDialog::T602ImportFilterDialog() :
- mpResMgr( nullptr ) {}
+T602ImportFilterDialog::T602ImportFilterDialog()
+ : mpResLocale(nullptr)
+{
+}
T602ImportFilterDialog::~T602ImportFilterDialog()
{
@@ -1086,14 +1090,14 @@ bool T602ImportFilterDialog::OptionsDlg()
void T602ImportFilterDialog::initLocale()
{
- mpResMgr.reset( ResMgr::CreateResMgr( "t602filter", LanguageTag( meLocale) ) );
+ mpResLocale.reset(new std::locale(Translate::Create("flt", LanguageTag(meLocale))));
}
-ResMgr* T602ImportFilterDialog::getResMgr()
+const std::locale* T602ImportFilterDialog::getResLocale()
{
- if( !mpResMgr )
+ if (!mpResLocale)
initLocale();
- return mpResMgr.get();
+ return mpResLocale.get();
}
void SAL_CALL T602ImportFilterDialog::setTitle( const OUString& )
@@ -1108,10 +1112,9 @@ sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
return css::ui::dialogs::ExecutableDialogResults::CANCEL;
}
-OUString T602ImportFilterDialog::getResStr( sal_Int16 resid )
+OUString T602ImportFilterDialog::getResStr(const char* resid)
{
- OUString sStr( ResId( resid, *getResMgr() ) );
- return sStr;
+ return Translate::get(resid, *getResLocale());
}
uno::Sequence<beans::PropertyValue> SAL_CALL T602ImportFilterDialog::getPropertyValues()
diff --git a/filter/source/t602/t602filter.hrc b/filter/source/t602/t602filter.hrc
deleted file mode 100644
index 7cb9a9d1f712..000000000000
--- a/filter/source/t602/t602filter.hrc
+++ /dev/null
@@ -1,39 +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 .
- */
-
-#ifndef T602FILTER_HRC
-#define T602FILTER_HRC
-
-#define T602FILTER_RES_START 1000
-
-#define T602FILTER_STR_IMPORT_DIALOG_TITLE (T602FILTER_RES_START)
-#define T602FILTER_STR_ENCODING_LABEL (T602FILTER_RES_START+1)
-#define T602FILTER_STR_ENCODING_AUTO (T602FILTER_RES_START+2)
-#define T602FILTER_STR_ENCODING_CP852 (T602FILTER_RES_START+3)
-#define T602FILTER_STR_ENCODING_CP895 (T602FILTER_RES_START+4)
-#define T602FILTER_STR_ENCODING_KOI8CS2 (T602FILTER_RES_START+5)
-#define T602FILTER_STR_CYRILLIC_MODE (T602FILTER_RES_START+6)
-#define T602FILTER_STR_REFORMAT_TEXT (T602FILTER_RES_START+7)
-#define T602FILTER_STR_DOT_COMMANDS (T602FILTER_RES_START+8)
-#define T602FILTER_STR_CANCEL_BUTTON (T602FILTER_RES_START+9)
-#define T602FILTER_STR_OK_BUTTON (T602FILTER_RES_START+10)
-
-#endif // T602FILTER_HRC
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx
index e7b0c452b64c..8d81fb1b476a 100644
--- a/filter/source/t602/t602filter.hxx
+++ b/filter/source/t602/t602filter.hxx
@@ -33,7 +33,6 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <cppuhelper/implbase.hxx>
#include <xmloff/attrlist.hxx>
-#include <tools/resmgr.hxx>
namespace T602ImportFilter {
@@ -84,10 +83,10 @@ class T602ImportFilterDialog : public cppu::WeakImplHelper <
>
{
css::lang::Locale meLocale;
- std::unique_ptr<ResMgr> mpResMgr;
+ std::unique_ptr<std::locale> mpResLocale;
bool OptionsDlg();
- ResMgr* getResMgr();
- OUString getResStr( sal_Int16 resid );
+ const std::locale* getResLocale();
+ OUString getResStr(const char* resid);
void initLocale();
virtual ~T602ImportFilterDialog() override;
diff --git a/filter/source/t602/t602filter.src b/filter/source/t602/t602filter.src
deleted file mode 100644
index 6771ee28ff20..000000000000
--- a/filter/source/t602/t602filter.src
+++ /dev/null
@@ -1,77 +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 "t602filter.hrc"
-
-String T602FILTER_STR_IMPORT_DIALOG_TITLE
-{
- Text [ en-US ] = "Settings for T602 import";
-};
-
-String T602FILTER_STR_ENCODING_LABEL
-{
- Text [ en-US ] = "Encoding";
-};
-
-String T602FILTER_STR_ENCODING_AUTO
-{
- Text [ en-US ] = "Automatic";
-};
-
-String T602FILTER_STR_ENCODING_CP852
-{
- Text [ en-US ] = "CP852 (Latin2)";
-};
-
-String T602FILTER_STR_ENCODING_CP895
-{
- Text [ en-US ] = "CP895 (KEYB2CS, Kamenicky)";
-};
-
-String T602FILTER_STR_ENCODING_KOI8CS2
-{
- Text [ en-US ] = "KOI8 CS2";
-};
-
-String T602FILTER_STR_CYRILLIC_MODE
-{
- Text [ en-US ] = "Mode for Russian language (Cyrillic)";
-};
-
-String T602FILTER_STR_REFORMAT_TEXT
-{
- Text [ en-US ] = "Reformat the text";
-};
-
-String T602FILTER_STR_DOT_COMMANDS
-{
- Text [ en-US ] = "Display dot commands";
-};
-
-String T602FILTER_STR_CANCEL_BUTTON
-{
- Text [ en-US ] = "Cancel";
-};
-
-String T602FILTER_STR_OK_BUTTON
-{
- Text [ en-US ] = "OK";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xsltdialog/xmlfilterdialogstrings.hrc b/filter/source/xsltdialog/xmlfilterdialogstrings.hrc
deleted file mode 100644
index 8db23c2ad6bc..000000000000
--- a/filter/source/xsltdialog/xmlfilterdialogstrings.hrc
+++ /dev/null
@@ -1,55 +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 .
- */
-
-#ifndef INCLUDED_FILTER_SOURCE_XSLTDIALOG_XMLFILTERDIALOGSTRINGS_HRC
-#define INCLUDED_FILTER_SOURCE_XSLTDIALOG_XMLFILTERDIALOGSTRINGS_HRC
-
-#include "filter.hrc"
-
-#define STR_COLUMN_HEADER_NAME (RID_XSLT_DIALOG_START + 0)
-#define STR_COLUMN_HEADER_TYPE (RID_XSLT_DIALOG_START + 1)
-#define STR_UNKNOWN_APPLICATION (RID_XSLT_DIALOG_START + 2)
-#define STR_IMPORT_ONLY (RID_XSLT_DIALOG_START + 3)
-#define STR_IMPORT_EXPORT (RID_XSLT_DIALOG_START + 4)
-#define STR_EXPORT_ONLY (RID_XSLT_DIALOG_START + 5)
-
-#define STR_WARN_DELETE (RID_XSLT_DIALOG_START + 10)
-
-#define STR_DEFAULT_FILTER_NAME (RID_XSLT_DIALOG_START + 13)
-
-#define STR_ERROR_FILTER_NAME_EXISTS (RID_XSLT_DIALOG_START + 15)
-#define STR_ERROR_TYPE_NAME_EXISTS (RID_XSLT_DIALOG_START + 16)
-#define STR_ERROR_EXPORT_XSLT_NOT_FOUND (RID_XSLT_DIALOG_START + 18)
-#define STR_ERROR_IMPORT_XSLT_NOT_FOUND (RID_XSLT_DIALOG_START + 19)
-#define STR_ERROR_IMPORT_TEMPLATE_NOT_FOUND (RID_XSLT_DIALOG_START + 20)
-#define STR_DEFAULT_UI_NAME (RID_XSLT_DIALOG_START + 21)
-#define STR_UNDEFINED_FILTER (RID_XSLT_DIALOG_START + 22)
-
-#define STR_FILTER_HAS_BEEN_SAVED (RID_XSLT_DIALOG_START + 23)
-#define STR_FILTERS_HAVE_BEEN_SAVED (RID_XSLT_DIALOG_START + 24)
-#define STR_FILTER_PACKAGE (RID_XSLT_DIALOG_START + 25)
-#define STR_FILTER_INSTALLED (RID_XSLT_DIALOG_START + 26)
-#define STR_FILTERS_INSTALLED (RID_XSLT_DIALOG_START + 27)
-#define STR_NO_FILTERS_FOUND (RID_XSLT_DIALOG_START + 28)
-
-#define STR_XML_FILTER_LISTBOX (RID_XSLT_DIALOG_START + 38)
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xsltdialog/xmlfilterdialogstrings.src b/filter/source/xsltdialog/xmlfilterdialogstrings.src
deleted file mode 100644
index ea7a693a2257..000000000000
--- a/filter/source/xsltdialog/xmlfilterdialogstrings.src
+++ /dev/null
@@ -1,132 +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 "xmlfilterdialogstrings.hrc"
-
-String STR_COLUMN_HEADER_NAME
-{
- Text [ en-US ] = "Name";
-};
-
-String STR_COLUMN_HEADER_TYPE
-{
- Text [ en-US ] = "Type";
-};
-
-String STR_UNKNOWN_APPLICATION
-{
- Text [ en-US ] = "Unknown";
-};
-
-String STR_IMPORT_ONLY
-{
- Text [ en-US ] = "import filter";
-};
-
-String STR_IMPORT_EXPORT
-{
- Text [ en-US ] = "import/export filter";
-};
-
-String STR_EXPORT_ONLY
-{
- Text [ en-US ] = "export filter";
-};
-
-String STR_WARN_DELETE
-{
- Text [ en-US ] = "Do you really want to delete the XML Filter '%s'? This action cannot be undone.";
-};
-
-String STR_ERROR_FILTER_NAME_EXISTS
-{
- Text [ en-US ] = "An XML filter with the name '%s' already exists. Please enter a different name.";
-};
-
-String STR_ERROR_TYPE_NAME_EXISTS
-{
- Text [ en-US ] = "The name for the user interface '%s1' is already used by the XML filter '%s2'. Please enter a different name.";
-};
-
-String STR_ERROR_EXPORT_XSLT_NOT_FOUND
-{
- Text [ en-US ] = "The XSLT for export cannot be found. Please enter a valid path.";
-};
-
-String STR_ERROR_IMPORT_XSLT_NOT_FOUND
-{
- Text [ en-US ] = "The XSLT for import cannot be found. Please enter a valid path.";
-};
-
-String STR_ERROR_IMPORT_TEMPLATE_NOT_FOUND
-{
- Text [ en-US ] = "The given import template cannot be found. Please enter a valid path.";
-};
-
-String STR_DEFAULT_FILTER_NAME
-{
- Text [ en-US ] = "New Filter";
-};
-
-String STR_DEFAULT_UI_NAME
-{
- Text [ en-US ] = "Untitled";
-};
-
-String STR_UNDEFINED_FILTER
-{
- Text [ en-US ] = "undefined filter";
-};
-
-String STR_FILTER_HAS_BEEN_SAVED
-{
- Text [ en-US ] = "The XML filter '%s' has been saved as package '%s'. ";
-};
-
-String STR_FILTERS_HAVE_BEEN_SAVED
-{
- Text [ en-US ] = "%s XML filters have been saved in the package '%s'.";
-};
-
-String STR_FILTER_PACKAGE
-{
- Text [ en-US ] = "XSLT filter package";
-};
-
-String STR_FILTER_INSTALLED
-{
- Text [ en-US ] = "The XML filter '%s' has been installed successfully.";
-};
-
-String STR_FILTERS_INSTALLED
-{
- Text [ en-US ] = "%s XML filters have been installed successfully.";
-};
-
-String STR_NO_FILTERS_FOUND
-{
- Text [ en-US ] = "No XML filter could be installed because the package '%s' does not contain any XML filters.";
-};
-
-String STR_XML_FILTER_LISTBOX
-{
- Text [ en-US ] = "XML Filter List";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index f80e8f8a5820..388235716aef 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -42,7 +42,7 @@
#include <rtl/uri.hxx>
#include "xmlfilterjar.hxx"
-#include "xmlfilterdialogstrings.hrc"
+#include "strings.hrc"
#include "xmlfiltersettingsdialog.hxx"
#include "typedetectionexport.hxx"
#include "typedetectionimport.hxx"
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 1abaf3c1b3ac..5d26460f1a00 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -41,7 +41,7 @@
#include <algorithm>
#include <memory>
-#include "xmlfilterdialogstrings.hrc"
+#include "strings.hrc"
#include "xmlfiltersettingsdialog.hxx"
#include "xmlfiltertabdialog.hxx"
#include "xmlfiltertestdialog.hxx"
@@ -59,34 +59,34 @@ using namespace com::sun::star::util;
using ::rtl::Uri;
namespace {
- static ResMgr* pXSLTResMgr = nullptr;
+ static std::locale* pXSLTResLocale = nullptr;
- ResMgr* getXSLTDialogResMgr()
+ const std::locale* getXSLTDialogResLocale()
{
- return pXSLTResMgr;
+ return pXSLTResLocale;
}
}
-EnsureResMgr::EnsureResMgr()
+EnsureResLocale::EnsureResLocale()
{
- if (!pXSLTResMgr)
+ if (!pXSLTResLocale)
{
- m_xResMgr.reset(ResMgr::CreateResMgr("xsltdlg", Application::GetSettings().GetUILanguageTag()));
- pXSLTResMgr = m_xResMgr.get();
+ m_xResLocale.reset(new std::locale(Translate::Create("flt", Application::GetSettings().GetUILanguageTag())));
+ pXSLTResLocale = m_xResLocale.get();
}
}
-EnsureResMgr::~EnsureResMgr()
+EnsureResLocale::~EnsureResLocale()
{
- if (m_xResMgr)
- pXSLTResMgr = nullptr;
+ if (m_xResLocale)
+ pXSLTResLocale = nullptr;
}
namespace
{
- OUString XsltResId(sal_uInt16 nId)
+ OUString XsltResId(const char* pId)
{
- return ResId(nId, *getXSLTDialogResMgr());
+ return Translate::get(pId, *getXSLTDialogResLocale());
}
}
@@ -263,7 +263,7 @@ void XMLFilterSettingsDialog::onNew()
aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";
// execute XML Filter Dialog
- ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResLocale(), mxContext, &aTempInfo );
if ( aDlg->Execute() == RET_OK )
{
// insert the new filter
@@ -282,7 +282,7 @@ void XMLFilterSettingsDialog::onEdit()
filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
// execute XML Filter Dialog
- ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResLocale(), mxContext, pOldInfo );
if ( aDlg->Execute() == RET_OK )
{
filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();
@@ -1209,7 +1209,7 @@ void XMLFilterSettingsDialog::initFilterList()
application_info_impl::application_info_impl( const sal_Char * pDocumentService, const OUString& rUINameRes, const sal_Char * mpXMLImporter, const sal_Char * mpXMLExporter )
: maDocumentService( pDocumentService, strlen( pDocumentService ), RTL_TEXTENCODING_ASCII_US ),
- maDocumentUIName(ResMgr::ExpandVariables(rUINameRes)),
+ maDocumentUIName(Translate::ExpandVariables(rUINameRes)),
maXMLImporter( mpXMLImporter, strlen( mpXMLImporter ), RTL_TEXTENCODING_ASCII_US ),
maXMLExporter( mpXMLExporter, strlen( mpXMLExporter ), RTL_TEXTENCODING_ASCII_US )
{
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
index 5105c67936c2..7dfc307ce057 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
@@ -55,12 +55,12 @@ public:
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
};
-class EnsureResMgr
+class EnsureResLocale
{
- std::unique_ptr<ResMgr> m_xResMgr;
+ std::unique_ptr<std::locale> m_xResLocale;
public:
- EnsureResMgr();
- ~EnsureResMgr();
+ EnsureResLocale();
+ ~EnsureResLocale();
};
class HeaderBar;
@@ -68,7 +68,7 @@ class HeaderBar;
class XMLFilterListBox : public SvTabListBox
{
private:
- EnsureResMgr m_aEnsureResMgr;
+ EnsureResLocale m_aEnsureResLocale;
VclPtr<HeaderBar> m_pHeaderBar;
DECL_LINK( TabBoxScrollHdl_Impl, SvTreeListBox*, void );
@@ -127,7 +127,7 @@ private:
OUString createUniqueInterfaceName( const OUString& rInterfaceName );
private:
- EnsureResMgr maEnsureResMgr;
+ EnsureResLocale maEnsureResLocale;
css::uno::Reference< css::uno::XComponentContext > mxContext;
css::uno::Reference< css::container::XNameContainer > mxFilterContainer;
css::uno::Reference< css::container::XNameContainer > mxTypeDetection;
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 7da2fdee4bbd..2db0f6a08707 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -21,11 +21,11 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/fileurl.hxx>
-#include <tools/resid.hxx>
+#include <tools/resmgr.hxx>
#include <vcl/layout.hxx>
#include <osl/file.hxx>
-#include "xmlfilterdialogstrings.hrc"
+#include "strings.hrc"
#include "xmlfiltertabdialog.hxx"
#include "xmlfiltertabpagebasic.hxx"
#include "xmlfiltertabpagexslt.hxx"
@@ -36,11 +36,11 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
-XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent, ResMgr& rResMgr,
+XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent, const std::locale& rResLocale,
const Reference< XComponentContext >& rxContext, const filter_info_impl* pInfo)
: TabDialog(pParent, "XSLTFilterDialog","filter/ui/xsltfilterdialog.ui")
, mxContext(rxContext)
- , mrResMgr(rResMgr)
+ , mrResLocale(rResLocale)
{
get(m_pOKBtn, "ok");
get(m_pTabCtrl, "tabcontrol");
@@ -94,7 +94,7 @@ bool XMLFilterTabDialog::onOk()
mpBasicPage->FillInfo( mpNewInfo );
sal_uInt16 nErrorPage = 0;
- sal_uInt16 nErrorId = 0;
+ const char* pErrorId = nullptr;
vcl::Window* pFocusWindow = nullptr;
OUString aReplace1;
OUString aReplace2;
@@ -117,7 +117,7 @@ bool XMLFilterTabDialog::onOk()
if( xFilterContainer->hasByName( mpNewInfo->maFilterName ) )
{
nErrorPage = m_nBasicPageId;
- nErrorId = STR_ERROR_FILTER_NAME_EXISTS;
+ pErrorId = STR_ERROR_FILTER_NAME_EXISTS;
pFocusWindow = (mpBasicPage->m_pEDFilterName);
aReplace1 = mpNewInfo->maFilterName;
}
@@ -153,7 +153,7 @@ bool XMLFilterTabDialog::onOk()
sal_Int32 nFilter;
Sequence< PropertyValue > aValues;
- for( nFilter = 0; (nFilter < nCount) && (nErrorId == 0); nFilter++, pFilterName++ )
+ for( nFilter = 0; (nFilter < nCount) && (pErrorId == nullptr); nFilter++, pFilterName++ )
{
Any aAny( xFilterContainer->getByName( *pFilterName ) );
if( !(aAny >>= aValues) )
@@ -163,7 +163,7 @@ bool XMLFilterTabDialog::onOk()
PropertyValue* pValues = aValues.getArray();
sal_Int32 nValue;
- for( nValue = 0; (nValue < nValueCount) && (nErrorId == 0); nValue++, pValues++ )
+ for( nValue = 0; (nValue < nValueCount) && (pErrorId == nullptr); nValue++, pValues++ )
{
if ( pValues->Name == "UIName" )
{
@@ -172,7 +172,7 @@ bool XMLFilterTabDialog::onOk()
if( aInterfaceName == mpNewInfo->maInterfaceName )
{
nErrorPage = m_nBasicPageId;
- nErrorId = STR_ERROR_TYPE_NAME_EXISTS;
+ pErrorId = STR_ERROR_TYPE_NAME_EXISTS;
pFocusWindow = (mpBasicPage->m_pEDInterfaceName);
aReplace1 = mpNewInfo->maInterfaceName;
aReplace2 = *pFilterName;
@@ -189,7 +189,7 @@ bool XMLFilterTabDialog::onOk()
}
}
- if( 0 == nErrorId )
+ if (!pErrorId)
{
// 4. see if the export xslt is valid
if( (mpNewInfo->maExportXSLT != mpOldInfo->maExportXSLT) && comphelper::isFileUrl( mpNewInfo->maExportXSLT ) )
@@ -198,14 +198,14 @@ bool XMLFilterTabDialog::onOk()
osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
if( aRC != osl::File::E_None )
{
- nErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
+ pErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
nErrorPage = m_nXSLTPageId;
pFocusWindow = (mpXSLTPage->m_pEDExportXSLT);
}
}
}
- if( 0 == nErrorId )
+ if (!pErrorId)
{
// 5. see if the import xslt is valid
if( (mpNewInfo->maImportXSLT != mpOldInfo->maImportXSLT) && comphelper::isFileUrl( mpNewInfo->maImportXSLT ) )
@@ -214,7 +214,7 @@ bool XMLFilterTabDialog::onOk()
osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
if( aRC != osl::File::E_None )
{
- nErrorId = STR_ERROR_IMPORT_XSLT_NOT_FOUND;
+ pErrorId = STR_ERROR_IMPORT_XSLT_NOT_FOUND;
nErrorPage = m_nXSLTPageId;
pFocusWindow = (mpXSLTPage->m_pEDImportTemplate);
}
@@ -224,12 +224,12 @@ bool XMLFilterTabDialog::onOk()
// see if we have at least an import or an export xslt
if((mpNewInfo->maImportXSLT.isEmpty()) && (mpNewInfo->maExportXSLT.isEmpty()) )
{
- nErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
+ pErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND;
nErrorPage = m_nXSLTPageId;
pFocusWindow = (mpXSLTPage->m_pEDExportXSLT);
}
- if( 0 == nErrorId )
+ if (!pErrorId)
{
// 6. see if the import template is valid
if( (mpNewInfo->maImportTemplate != mpOldInfo->maImportTemplate) && comphelper::isFileUrl( mpNewInfo->maImportTemplate ) )
@@ -238,20 +238,19 @@ bool XMLFilterTabDialog::onOk()
osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read );
if( aRC != osl::File::E_None )
{
- nErrorId = STR_ERROR_IMPORT_TEMPLATE_NOT_FOUND;
+ pErrorId = STR_ERROR_IMPORT_TEMPLATE_NOT_FOUND;
nErrorPage = m_nXSLTPageId;
pFocusWindow = (mpXSLTPage->m_pEDImportTemplate);
}
}
}
- if( 0 != nErrorId )
+ if (pErrorId)
{
m_pTabCtrl->SetCurPageId(nErrorPage);
ActivatePageHdl(nullptr, m_pTabCtrl);
- ResId aResId( nErrorId, mrResMgr );
- OUString aMessage( aResId );
+ OUString aMessage(Translate::get(pErrorId, mrResLocale));
if( aReplace2.getLength() )
{
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.hxx b/filter/source/xsltdialog/xmlfiltertabdialog.hxx
index 4602af7907b9..c51656b84742 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.hxx
@@ -25,7 +25,6 @@
#include <vcl/button.hxx>
namespace vcl { class Window; }
-class ResMgr;
class filter_info_impl;
class XMLFilterTabPageBasic;
@@ -34,7 +33,7 @@ class XMLFilterTabPageXSLT;
class XMLFilterTabDialog: public TabDialog
{
public:
- XMLFilterTabDialog(vcl::Window *pParent, ResMgr& rResMgr, const css::uno::Reference< css::uno::XComponentContext >& rxContext, const filter_info_impl* pInfo);
+ XMLFilterTabDialog(vcl::Window *pParent, const std::locale& rResLocale, const css::uno::Reference< css::uno::XComponentContext >& rxContext, const filter_info_impl* pInfo);
virtual ~XMLFilterTabDialog() override;
virtual void dispose() override;
@@ -48,7 +47,7 @@ private:
DECL_STATIC_LINK( XMLFilterTabDialog, ActivatePageHdl, TabControl*, void );
DECL_LINK(OkHdl, Button*, void);
- ResMgr& mrResMgr;
+ const std::locale& mrResLocale;
const filter_info_impl* mpOldInfo;
filter_info_impl* mpNewInfo;
diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
index fe6a2b7f449c..a868fb244b06 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
@@ -19,7 +19,7 @@
#include <rtl/ustrbuf.hxx>
-#include "xmlfilterdialogstrings.hrc"
+#include "strings.hrc"
#include "xmlfiltertabpagebasic.hxx"
#include "xmlfiltersettingsdialog.hxx"
diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
index ce6e9fc20d48..e366703e8a0c 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
@@ -26,7 +26,6 @@
#include <svtools/svmedit.hxx>
namespace vcl { class Window; }
-class ResMgr;
class filter_info_impl;
class XMLFilterTabPageBasic : public TabPage
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
index 9d88183cdf96..c5e84aa0072e 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
@@ -27,7 +27,6 @@
#include <svtools/inettbc.hxx>
namespace vcl { class Window; }
-class ResMgr;
class filter_info_impl;
class XMLFilterTabPageXSLT : public TabPage
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index 3cf1f5abd618..65c150db33b2 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -44,7 +44,7 @@
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
-#include "xmlfilterdialogstrings.hrc"
+#include "strings.hrc"
#include "xmlfiltersettingsdialog.hxx"
#include "xmlfiltertestdialog.hxx"