Kaydet (Commit) d1f7124c authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Michael Meeks

Get Labels.xcu out of configuration data.

Modify the file format, install separately into share/labels,
and parse it using xmlreader when needed.
Saves time on startup and reduces pointless configurarion size.
üst 8cefe14f
......@@ -13,6 +13,7 @@ $(eval $(call gb_Module_add_targets,extras,\
AllLangZip_autotextshare \
CustomTarget_autocorr \
Package_fonts \
Package_labels \
Package_newfiles \
Package_wordbook \
Zip_autocorr \
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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_Package_Package,extras_labels,$(SRCDIR)/extras/source/labels))
$(eval $(call gb_Package_add_file,extras_labels,pck/labels.xml,labels.xml))
# vim: set noet sw=4 ts=4:
This diff is collapsed.
......@@ -102,8 +102,6 @@ bool passesNegativeList(OUString const & url) {
{ RTL_CONSTASCII_STRINGPARAM(
"/officecfg/registry/data/org/openoffice/Office/"
"Accelerators.xcu") },
{ RTL_CONSTASCII_STRINGPARAM(
"/officecfg/registry/data/org/openoffice/Office/Labels.xcu") },
{ RTL_CONSTASCII_STRINGPARAM(
"/officecfg/registry/data/org/openoffice/Office/SFX.xcu") }
};
......
......@@ -36,7 +36,6 @@ $(eval $(call gb_Configuration_add_datas,registry,officecfg/registry/data,\
org/openoffice/Office/ExtensionManager.xcu \
org/openoffice/Office/Impress.xcu \
org/openoffice/Office/Jobs.xcu \
org/openoffice/Office/Labels.xcu \
org/openoffice/Office/Linguistic.xcu \
org/openoffice/Office/Logging.xcu \
org/openoffice/Office/Math.xcu \
......
......@@ -224,7 +224,6 @@ postprocess_FILES_main := \
$(postprocess_XCU)/Office/Histories.xcu \
$(postprocess_XCU)/Office/Impress.xcu \
$(postprocess_XCU)/Office/Jobs.xcu \
$(postprocess_XCU)/Office/Labels.xcu \
$(postprocess_XCU)/Office/Logging.xcu \
$(postprocess_XCU)/Office/Math.xcu \
$(postprocess_XCU)/Office/Paths.xcu \
......
......@@ -42,6 +42,7 @@ Module gid_Module_Root_Brand
gid_Brand_Dir_Share_Extensions,
gid_Brand_Dir_Share_Uno_Packages,
gid_Brand_Dir_Share_Uno_Packages_Cache,
gid_Brand_Dir_Share_Labels,
gid_Brand_Dir_Share_Registry,
gid_Brand_Dir_Share_Xdg);
Files = (gid_Brand_File_Bin_Crashreport,
......@@ -418,6 +419,11 @@ Directory gid_Brand_Dir_Share_Uno_Packages_Cache_Uno_Packages
Styles = (CREATE);
End
Directory gid_Brand_Dir_Share_Labels
ParentID = gid_Brand_Dir_Share;
DosName = "labels";
End
Directory gid_Brand_Dir_Share_Registry
ParentID = gid_Brand_Dir_Share;
DosName = "registry";
......
......@@ -625,6 +625,13 @@ End
#endif
File gid_File_Share_Labels_Xml
TXT_FILE_BODY;
Styles = (PACKED);
Dir = gid_Brand_Dir_Share_Labels;
Name = "labels.xml";
End
File gid_File_Share_Registry_Main_Xcd
TXT_FILE_BODY;
Styles = (PACKED, SCPZIP_REPLACE);
......
......@@ -536,6 +536,7 @@ Module gid_Module_Root_Files_6
gid_File_Mod_Text,
gid_File_Oo_Ldap_Xcd_Sample,
gid_File_Oo_Ad_Ldap_Xcd_Sample,
gid_File_Share_Labels_Xml,
gid_File_Share_Registry_Main_Xcd,
gid_File_Share_Registry_Forcedefault_Xcd,
gid_File_Pymailmerge,
......
......@@ -66,6 +66,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
utl \
vbahelper \
vcl \
xmlreader \
xo \
$(gb_UWINAPI) \
))
......
......@@ -68,6 +68,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
utl \
vbahelper \
vcl \
xmlreader \
xo \
$(gb_UWINAPI) \
))
......
......@@ -153,13 +153,12 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet,
pRecs->insert( pRecs->begin(), pRec );
sal_uInt16 nLstGroup = 0;
const ::com::sun::star::uno::Sequence<rtl::OUString>& rMan = aLabelsCfg.GetManufacturers();
const rtl::OUString* pMan = rMan.getConstArray();
for(sal_Int32 nMan = 0; nMan < rMan.getLength(); nMan++)
const std::vector<rtl::OUString>& rMan = aLabelsCfg.GetManufacturers();
for(sal_uInt16 nMan = 0; nMan < rMan.size(); nMan++)
{
aMakes.push_back(pMan[nMan]);
if ( pMan[nMan] == aItem.aLstMake )
nLstGroup = (sal_uInt16) nMan;
aMakes.push_back(rMan[nMan]);
if ( rMan[nMan] == aItem.aLstMake )
nLstGroup = nMan;
}
if ( !aMakes.empty() )
......
......@@ -576,14 +576,11 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
if(pSaveDlg->GetLabel(aItem))
{
bModified = false;
const Sequence<OUString>& rMan = GetParentSwLabDlg()->GetLabelsConfig().GetManufacturers();
const std::vector<OUString>& rMan = GetParentSwLabDlg()->GetLabelsConfig().GetManufacturers();
std::vector<rtl::OUString>& rMakes(GetParentSwLabDlg()->Makes());
if(rMakes.size() < (sal_uInt16)rMan.getLength())
if(rMakes.size() < rMan.size())
{
rMakes.clear();
const OUString* pMan = rMan.getConstArray();
for(sal_Int32 nMan = 0; nMan < rMan.getLength(); nMan++)
rMakes.push_back(pMan[nMan]);
rMakes = rMan;
}
aMakeFI.SetText(aItem.aMake);
aTypeFI.SetText(aItem.aType);
......@@ -618,10 +615,9 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) :
aTypeED.SetModifyHdl(aLk);
SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig();
const Sequence<OUString>& rMan = rCfg.GetManufacturers();
const OUString* pMan = rMan.getConstArray();
for(sal_Int32 i = 0; i < rMan.getLength(); i++)
aMakeCB.InsertEntry(pMan[i]);
const std::vector<OUString>& rMan = rCfg.GetManufacturers();
for (sal_uInt16 i = 0; i < rMan.size(); i++)
aMakeCB.InsertEntry(rMan[i]);
}
IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
......
......@@ -22,14 +22,16 @@
#include <unotools/configitem.hxx>
#include "swdllapi.h"
#include <map>
#include <vector>
class SwLabRecs;
class SwLabRec;
class SW_DLLPUBLIC SwLabelConfig : public utl::ConfigItem
{
com::sun::star::uno::Sequence<rtl::OUString> aNodeNames;
SW_DLLPRIVATE com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
std::vector<rtl::OUString> m_aManufacturers;
std::map< OUString, std::map<OUString, OUString> > m_aLabels;
public:
SwLabelConfig();
......@@ -38,9 +40,9 @@ public:
virtual void Commit();
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
void FillManufacturers();
void FillLabels(const rtl::OUString& rManufacturer, SwLabRecs& rLabArr);
const com::sun::star::uno::Sequence<rtl::OUString>&
GetManufacturers() const {return aNodeNames;}
const std::vector<rtl::OUString>& GetManufacturers() const {return m_aManufacturers;}
sal_Bool HasLabel(const rtl::OUString& rManufacturer, const rtl::OUString& rType);
void SaveLabel(const rtl::OUString& rManufacturer, const rtl::OUString& rType,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment